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

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

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.8.8, 2.9.2
    • 2.8.6, 2.9
    • General
    • MOODLE_28_STABLE, MOODLE_29_STABLE
    • MOODLE_28_STABLE, MOODLE_29_STABLE
    • 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.

      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.

            maherne Michael Aherne
            maherne Michael Aherne
            Ankit Agarwal Ankit Agarwal
            Andrew Lyons Andrew Lyons
            John Okely John Okely
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.