Skip Menu |

This queue is for tickets about the Catalyst-Plugin-Scheduler CPAN distribution.

Report information
The Basics
Id: 32083
Status: resolved
Priority: 0/
Queue: Catalyst-Plugin-Scheduler

People
Owner: Nobody in particular
Requestors: knut-olav [...] hoven.ws
Cc:
AdminCc:

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



Subject: Invalid state of events after a crash
When Catalyst is forced to exit (ie. during a crash) during the execution of an event, the state of the event is set to "running" and is never reset. Therefore the event will never be run again until the state file is deleted.
Subject: scheduler-invalid-state.patch
Index: lib/Catalyst/Plugin/Scheduler.pm =================================================================== --- lib/Catalyst/Plugin/Scheduler.pm (revision 451) +++ lib/Catalyst/Plugin/Scheduler.pm (revision 452) @@ -157,6 +157,19 @@ $c->config->{scheduler}->{state_file} ||= $c->path_to('scheduler.state'); $c->config->{scheduler}->{hosts_allow} ||= '127.0.0.1'; $c->config->{scheduler}->{yaml_file} ||= $c->path_to('scheduler.yml'); + + if (-e $c->config->{scheduler}->{state_file}) { + $c->log->debug( + sprintf( + 'Scheduler: Removing old state file "%s"', + $c->config->{scheduler}->{state_file} + ) + ) + if $c->config->{scheduler}->{logging}; + + unlink $c->config->{scheduler}->{state_file} + or die("Unable to remove old state file!"); + } $c->NEXT::setup(@_); }
Thanks, patch applied and released as 0.08.