Skip Menu |

This queue is for tickets about the IO-Async CPAN distribution.

Report information
The Basics
Id: 124414
Status: resolved
Priority: 0/
Queue: IO-Async

People
Owner: Nobody in particular
Requestors: leonerd-cpan [...] leonerd.org.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.71
Fixed in: 0.72



Subject: Periodic timer `skip` mode calculation wrong
With large intervals the skip logic seems to be totally wrong. -- Paul Evans
This likely fixes it -- Paul Evans
Subject: rt124414.patch
=== modified file 'lib/IO/Async/Timer/Periodic.pm' --- lib/IO/Async/Timer/Periodic.pm 2016-12-22 15:56:29 +0000 +++ lib/IO/Async/Timer/Periodic.pm 2018-02-13 16:16:50 +0000 @@ -185,7 +185,7 @@ } elsif( $resched eq "skip" ) { # How many ticks are needed? - my $ticks = POSIX::ceil( $now - $self->{next_time} ); + my $ticks = POSIX::ceil( ( $now - $self->{next_time} ) / $next_interval ); # $self->{last_ticks} = $ticks; $self->{next_time} += $next_interval * $ticks; }
Was released in 0.72 -- Paul Evans