User tests: Successful: Unsuccessful:
Pull Request resolves # .
Sometimes a scheduled task may stop unexpectedly (for example due to a timeout or server issue). When this happens, the task remains marked as “locked”.
Currently, if a task is locked, Joomla assumes it is still running even if it is already timed out (the default time out for a scheduled task is 300 seconds). This prevents all other scheduled tasks from being executed.
This PR updates the Scheduler so that if a task has been locked longer than the configured timeout, it will no longer block other scheduled tasks. This allows the Scheduler to recover automatically if a task gets stuck.
UPDATE `jos_scheduler_tasks` SET `locked`='2025-02-24 21:56:11' WHERE `id`=1;When there is a task locked (after you run the SQL command above), that locked task will prevent all other tasks (including itself) from being executed. So you do not see Last Run Date updated anymore.
The scheduled tasks will continue being executed as expected. A crashed/none finished running task won't block other tasks from being executed.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration |
I have tested this item ✅ successfully on 3e3545d
postgres 15
I have tested this item ✅ successfully on 3e3545d
MySQL
I have tested this item ✅ successfully on 3e3545d
| Status | Pending | ⇒ | Ready to Commit |
| Labels |
Added:
bug
PR-5.4-dev
|
||
RTC
| Labels |
Added:
RTC
|
||
✅ Final test before merge using JBT
joomla_scheduler.php log file| Status | Ready to Commit | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-03-08 06:08:38 |
| Closed_By | ⇒ | muhme |
Thank you @joomdonation for your contribution. Thank you @alikon, @dautrich and @krishnagandhicode for testing.
Thanks !
I would like to provide more information in case someone wants to understand the issue and the solution while doing code review.
schedulerunnersystem plugin. Before injecting the JS script, Joomla checks whether scheduled tasks should run, the check is called here. That check calls thehasDueTasks()method in the TasksModel modelCurrently, this method returns
falseif there is any locked task, without checking the configured timeout. So if a task does not finish its execution (for example due to timeout or crash), Joomla still thinks it is running. Because of that, the JS script is no longer injected, and scheduled tasks are never triggered again.In this PR, that method is modified so that a task is only considered running if it is locked and not timed out. This allows Joomla to continue injecting the script and triggering scheduled tasks.
Currently,
hasRunningTasks()returnstrueif there is any locked task and does not consider the timeout setting. So if a task crashes and remains locked, Joomla will stop executing all other tasks. This PR modifies that method so it only returnstrueif there is an actual running task (locked and not timed out).Because of this behavior, we have received reports such as #46103, when a task like update notification failed, it prevent all other scheduled tasks such as Session GC stop running, causing the session table to grow large and potentially affecting site performance.
This change makes the Scheduler respect the configured timeout and prevents a stuck task from blocking other scheduled tasks. Hopefully we will get this issue fixed so that Scheduled task will be more reliable.