RTC bug PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
24 Feb 2026

Pull Request resolves # .

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

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.

Testing Instructions

  1. Use Joomla 5.4
  2. Access to System - Scheduled Tasks:
  • Disable all tasks and only keep the first two scheduled tasks enabled (to make it easier to monitor): Rotate Logs (ID = 1) and Session GC (ID = 2)
  • Edit the two scheduled tasks, configure it so that it is executed every 1 minute
  • Access to Options button in the toolbar, click on Lazy Scheduler, set Request Interval (seconds) to 30 instead of 300 by default.
  • Access to frontend of your site and wait for Joomla trigger scheduled tasks. Wait for 1 or 2 minutes, then refresh the scheduled tasks page, make sure the tasks are executed (the Last Run Date column updated)
  • Access to your site database via PHPMYADMIN, run this SQL command to have the first task locked (remember to replace jos_scheduler_tasks with correct table name, depends on the database table prefix uses on your site)
UPDATE `jos_scheduler_tasks` SET `locked`='2025-02-24 21:56:11' WHERE  `id`=1;
  • Then access to System - Scheduled Tasks again, and wait for one or two minutes. Refresh the page

Actual result BEFORE applying this Pull Request

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.

Expected result AFTER applying this Pull Request

The scheduled tasks will continue being executed as expected. A crashed/none finished running task won't block other tasks from being executed.

Link to documentations

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

Votes

# of Users Experiencing Issue
2/2
Average Importance Score
5.00

avatar joomdonation joomdonation - open - 24 Feb 2026
avatar joomdonation joomdonation - change - 24 Feb 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Feb 2026
Category Administration
avatar joomdonation joomdonation - change - 25 Feb 2026
The description was changed
avatar joomdonation joomdonation - edited - 25 Feb 2026
avatar joomdonation
joomdonation - comment - 25 Feb 2026

I would like to provide more information in case someone wants to understand the issue and the solution while doing code review.

  • By default, Joomla uses Lazy Scheduler to trigger scheduled tasks. A JavaScript file is injected into the frontend when visitors access the site. This is handled in the schedulerunner system plugin. Before injecting the JS script, Joomla checks whether scheduled tasks should run, the check is called here. That check calls the hasDueTasks() method in the TasksModel model

Currently, this method returns false if 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.

  • The second part is when Joomla tries to fetch a task to run. Before executing a task, it checks whether there is already a running task, the code is called here, which calls hasRunningTasks method.

Currently, hasRunningTasks() returns true if 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 returns true if 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.

avatar alikon alikon - test_item - 28 Feb 2026 - Tested successfully
avatar alikon
alikon - comment - 28 Feb 2026

I have tested this item ✅ successfully on 3e3545d

postgres 15


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47217.

avatar dautrich dautrich - test_item - 6 Mar 2026 - Tested successfully
avatar dautrich
dautrich - comment - 6 Mar 2026

I have tested this item ✅ successfully on 3e3545d

MySQL


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47217.

avatar krishnagandhicode krishnagandhicode - test_item - 6 Mar 2026 - Tested successfully
avatar krishnagandhicode
krishnagandhicode - comment - 6 Mar 2026

I have tested this item ✅ successfully on 3e3545d


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47217.

avatar richard67 richard67 - change - 6 Mar 2026
Status Pending Ready to Commit
Labels Added: bug PR-5.4-dev
avatar richard67
richard67 - comment - 6 Mar 2026

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47217.

avatar muhme muhme - change - 7 Mar 2026
Labels Added: RTC
avatar muhme
muhme - comment - 8 Mar 2026

✅ Final test before merge using JBT

  • Note: JBT is using cron based scheduler, but the problem could not be reproduced with cron based scheduler:run
    • Deleted the cron entry and enabled Lazy Scheduler
  • Tested two times, once with MariaDB and once with PostgreSQL
    • Checked in backend tasks are executed every minute and double checked in joomla_scheduler.php log file
    • Locked one task, seen no task is executed anymore
    • Applied PR with Patch Tester
      • Seen all tasks are running again and ¿as side effect? also the locked task is no more locked and executed again
avatar muhme muhme - close - 8 Mar 2026
avatar muhme muhme - merge - 8 Mar 2026
avatar muhme muhme - change - 8 Mar 2026
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
avatar muhme
muhme - comment - 8 Mar 2026

Thank you @joomdonation for your contribution. Thank you @alikon, @dautrich and @krishnagandhicode for testing.

avatar joomdonation
joomdonation - comment - 8 Mar 2026

Thanks !

Add a Comment

Login with GitHub to post a comment