Affects Version/s: 1.7.2, 1.8.2, 1.9
Affected Branches:MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
Fixed Branches:MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
While monitoring cron execution under one big site I've noticed that the execution was dying after some undetermined period (happening in different steps of the cron execution).
After some research, I think I've traced the cause of the problem. Explanation follows:
1) admin/cron.php sets time_limit to 0 (unlimited)
2) forum_cron is called and time_limit is set to 120
3) cron execution continues and, after 2 minutes, dies!
And this can be the cause of a lot of problems because some parts of the cron execution are never raised (clean-up tasks, backup...).
There are two possible solutions:
1) Forbid the use of "custom" time_limits within module/block... cron functions.
2) In the admin/cron-php set time_limit to 0 after each module/block... cron call.
Note that this is a problem since, at least, Moodle 1.7 ! And seems important!