We found a race-condition in getNextSchedule(): the case appears if a CronJob's `rule` is wrongly set.

In our case the CronJob rule was `1 * * * * ` (please notice the extra space after the last *), and in turn `getLastSchedule()` and`getIntervals()` returned FALSE.

This caused the `$interval` to stick to INFINITE and stuck to infinite loop.

There is no test covering such event.
Sorry not being able to provide a patch, up to now a "trim()" would suffice for our case, but of course it does not cover all the other cases.

Comments

thePanz created an issue. See original summary.

gielfeldt’s picture

Priority: Major » Minor
das-peter’s picture

Priority: Minor » Normal
Status: Active » Needs review
StatusFileSize
new1.13 KB

Infinite loops are not cool.
Just ran into this.
Created a patch which checks if the rule could be parsed and if not skips further handling.

  • arnested committed 21373db on 7.x-2.x authored by das-peter
    Issue #2685043 by das-peter: Infinite loop in getNextSchedule()
    
arnested’s picture

Status: Needs review » Fixed

Thank you for the patch. I have committed it to the 7.x-2.x branch and will do a new release including it later tonight.

arnested’s picture

Released in 7.x-2.8.

das-peter’s picture

Superb - thank you :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.