? Pending

User tests: Successful: Unsuccessful:

avatar nikosdion
nikosdion
14 Feb 2022

Summary of Changes

Scheduled Tasks never run when using the PDO MySQL database driver in Joomla. The CLI script replies with
<warning>Task#01 'CLI only backup at midnight' failed to run. Is it already running?</warning>

That's because you are trying to find the number of affected rows after unlocking the tables once you have tried to set a lock timestamp on the task row. However, this means that you trying to find out how many rows where affected by unlocking the tables, not how many tasks were affected by the UPDATE command which sets the lock timestamp! Therefore tasks remained locked without running.

This problem does not happen with the MySQLi driver because it operates differently under the hood. Fun times!

Tagging @bembelimen since this is a release blocker!

Testing Instructions

Make sure your site is using the PDO MySQL database driver. THIS IS NOT REPRODUCIBLE WITH THE mysqli DRIVER.

Create a new scheduled task.

Try to execute it with php ./joomla.php scheduler:run --all (AFTER applying my other PR #37034 which solves yet another issue with scheduled tasks).

Actual result BEFORE applying this Pull Request

You get the error
<warning>Task#01 'CLI only backup at midnight' failed to run. Is it already running?</warning>

Expected result AFTER applying this Pull Request

The task runs!

Documentation Changes Required

None.

avatar nikosdion nikosdion - open - 14 Feb 2022
avatar nikosdion nikosdion - change - 14 Feb 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Feb 2022
Category Administration
avatar softforge softforge - test_item - 14 Feb 2022 - Tested successfully
avatar softforge
softforge - comment - 14 Feb 2022

I have tested this item successfully on e8b6ccb

Got the error described here adn after applying the patch
the issue is resolved


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

avatar chmst chmst - test_item - 14 Feb 2022 - Tested successfully
avatar chmst
chmst - comment - 14 Feb 2022

I have tested this item successfully on e8b6ccb


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

avatar bembelimen bembelimen - close - 14 Feb 2022
avatar bembelimen bembelimen - merge - 14 Feb 2022
avatar bembelimen bembelimen - change - 14 Feb 2022
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-02-14 18:56:17
Closed_By bembelimen
Labels Added: ?
avatar bembelimen
bembelimen - comment - 14 Feb 2022

Thank you very much for this finding!

Add a Comment

Login with GitHub to post a comment