Skip Menu |

This queue is for tickets about the Attempt CPAN distribution.

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

Owner: Nobody in particular
Requestors: particle [...]

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

Subject: bugs in the way delays and retries are handled
Download (untitled) / with headers
text/plain 1014b
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
Download (untitled) / with headers
text/plain 102b
garage in garbage out. There's no correct behavior if you don't pass a number as arguments. Mark.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to