Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-50490

Fix for transactions breaking task system (backport of MDL-50009)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.6, 2.9
    • Fix Version/s: 2.8.8, 2.9.2
    • Component/s: General
    • Labels:
    • Testing Instructions:
      Hide
      1. Install the test plugin attached to the original issue, MDL-50009, and go to /admin/tool/mdl50009 to try to break your task queue
      2. Run your cron job
      3. Confirm that the task causes an error message to appear in the cron log
      4. Confirm that the record in task_adhoc hasn't been removed after the cron job finishes
      5. Raise some other task and repeat
      6. Confirm that the second task hasn't been prevented from running by the broken first task.
      Show
      Install the test plugin attached to the original issue, MDL-50009 , and go to /admin/tool/mdl50009 to try to break your task queue Run your cron job Confirm that the task causes an error message to appear in the cron log Confirm that the record in task_adhoc hasn't been removed after the cron job finishes Raise some other task and repeat Confirm that the second task hasn't been prevented from running by the broken first task.
    • Affected Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE

      Description

      In MDL-50009, we patched the task system so that any plugin (or potentially core) task which left a database transaction uncommitted couldn't prevent the task system from doing its job.

      I would really like to see this ported to supported releases, if possible, for the following reasons:

      1. It's arguably a bug. The cron log is reporting that tasks have completed successfully when, in fact, everything they have done (in the database) is rolled back afterwards. Also, a single ad-hoc task that leaves a transaction open breaks the entire task system.
      2. Unlike some other areas where badly-coded plugins can break things (e.g. Javascript or CSS), the effects of this problem can be subtle and hard to detect.

      Please see the original issue for more details if required.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Sep/15