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

Orphaned adhoc tasks for refresh_mod_calendar_events_task in faildelay loop

    • MOODLE_39_STABLE
    • MDL-68769_master
    • Hide
      1. Add remote and checkout the fix branch

        $ git remote add git@github.com:TomoTsuyuki/moodle.git
        $ git fetch --all
        $ git checkout MDL-68769_master
        

      2.  Checkout older version of course/lib.php and run phpunit to confirm the test is failed.

        $ git checkout fe3f594~1 -- course/lib.php
        $ vendor/bin/phpunit --testsuite=core_course_testsuite --filter=test_course_module_bulk_update_calendar_events
        Moodle 4.1rc2 (Build: 20221122), e7288cdb446ce7c201c0d96f0f5a5a6267faf3f6
        Php: 8.0.22, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 5.15.0-53-generic x86_64
        PHPUnit 9.5.25 #StandWithUkraine
        E 1 / 1 (100%)
        Time: 00:00.572, Memory: 82.50 MB
        There was 1 error:
        1) core_course\courselib_test::test_course_module_bulk_update_calendar_events
        dml_missing_record_exception: Can't find data record in database table course.
        (SELECT * FROM
        {course}
        WHERE id = ?
        [array (
        0 => '143000',
        )])
        

      3. Checkout the latest course/lib.php and run the test. Test doesn't have any errors.

        $ git checkout fe3f594 -- course/lib.php
        $ vendor/bin/phpunit --testsuite=core_course_testsuite --filter=test_course_module_bulk_update_calendar_events
        Moodle 4.1rc2 (Build: 20221122), e7288cdb446ce7c201c0d96f0f5a5a6267faf3f6
        Php: 8.0.22, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 5.15.0-53-generic x86_64
        PHPUnit 9.5.25 #StandWithUkraine
        . 1 / 1 (100%)
        Time: 00:00.350, Memory: 82.50 MB
        OK (1 test, 6 assertions)
        

         

      Show
      Add remote and checkout the fix branch $ git remote add git@github.com:TomoTsuyuki/moodle.git $ git fetch --all $ git checkout MDL-68769_master  Checkout older version of course/lib.php and run phpunit to confirm the test is failed. $ git checkout fe3f594~1 -- course/lib.php $ vendor/bin/phpunit --testsuite=core_course_testsuite --filter=test_course_module_bulk_update_calendar_events Moodle 4.1rc2 (Build: 20221122), e7288cdb446ce7c201c0d96f0f5a5a6267faf3f6 Php: 8.0.22, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 5.15.0-53-generic x86_64 PHPUnit 9.5.25 #StandWithUkraine E 1 / 1 (100%) Time: 00:00.572, Memory: 82.50 MB There was 1 error: 1) core_course\courselib_test::test_course_module_bulk_update_calendar_events dml_missing_record_exception: Can't find data record in database table course. (SELECT * FROM {course} WHERE id = ? [array ( 0 => '143000', )]) Checkout the latest course/lib.php and run the test. Test doesn't have any errors. $ git checkout fe3f594 -- course/lib.php $ vendor/bin/phpunit --testsuite=core_course_testsuite --filter=test_course_module_bulk_update_calendar_events Moodle 4.1rc2 (Build: 20221122), e7288cdb446ce7c201c0d96f0f5a5a6267faf3f6 Php: 8.0.22, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 5.15.0-53-generic x86_64 PHPUnit 9.5.25 #StandWithUkraine . 1 / 1 (100%) Time: 00:00.350, Memory: 82.50 MB OK (1 test, 6 assertions)  

      This is in the cron log:

      refresh_mod_calendar_events_task,Invalid course module ID

      But this fails and then goes in circles forever. It should instead just emit an error and then not throw an exception and then get cleaned up.

      I suspect this happens when a calendar is modified and then an activity maybe deleted quickly and the adhoc tasks get executed out of order.

       

      Note: there is a whole class of different core bugs with adhoc tasks going in circles failing forever. See MDL-68768

            tomotsuyuki Tomo Tsuyuki
            brendanheywood Brendan Heywood
            Jordi Pujol-Ahulló Jordi Pujol-Ahulló
            Votes:
            6 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:

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