Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.7.2, 1.8.2, 1.9
-
Component/s: Administration
-
Labels:None
-
Database:Any
-
Affected Branches:MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
-
Fixed Branches:MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
Description
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!
Ciao ![]()
I do not like setting it to 0, if something goes wrong then it may stay there for a long time, each part could IHMO reset the timer; or we could calculate the time of next cron run and set it just before it...
I guess it was me who added the short timeout there because we had some trouble with forum mailing at that time, hmmm