Skip Menu |

This queue is for tickets about the Attempt CPAN distribution.

Report information
The Basics
Id: 6791
Status: resolved
Priority: 0/
Queue: Attempt

People
Owner: Nobody in particular
Requestors: particle [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: bugs in the way delays and retries are handled
Attempt-1.01 code review unfortunately, there are bugs in the way delays and retries are handled. this is a classic bug--checking for existance of a key in a hash, without checking whether the value is valid. here's an example, from the attempt subroutine: # sleep if we need to select undef, undef, undef, $args{delay} if exists $args{delay}; if the delay key exists in the args hash, the select statement is run. but if the value of $args{delay} is undefined, select hangs. whoops! checking whether the value is defined, and can be properly evaluated by select in numeric context would fix this problem. similarly, this code # find out how many attempts we're going to take, # defaulting to two. my $tries = exists($args{tries}) ? $args{tries} : 2; will set $tries to undef if the key exists but is undefined. the same checks mentioned above would fix this problem as well. if you wish to have a patch, i can throw one together. also see my code review, which spawned this ticket. ~particle
garage in garbage out. There's no correct behavior if you don't pass a number as arguments. Mark.