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

Race condition generating images for attempt

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Originally found when using Libre Lambda Document Converter, but it affects all async converters

      1. Install attached pseudo async plugin fileconverter_example.zip  (copied from MDL-55528)
      2. Enable plugin in admin/settings.php?section=managefileconverterplugins
      3. Create assignment with file submission and enable annotations
      4. Submit file to assignment in format other than pdf - for example odt
      5. Run scheduled task

        php admin/tool/task/cli/schedule_task.php --execute='\assignfeedback_editpdf\task\convert_submissions'

      Expected behaviour: conversion is successful

      Actual behaviour: you will see error

      Conversion failed with error:Could not find readonly pages for grade 37342
      

      Show
      Originally found when using Libre Lambda Document Converter, but it affects all async converters Install attached pseudo async plugin fileconverter_example.zip  (copied from MDL-55528 ) Enable plugin in admin/settings.php?section=managefileconverterplugins Create assignment with file submission and enable annotations Submit file to assignment in format other than pdf - for example odt Run scheduled task php admin/tool/task/cli/schedule_task.php --execute= '\assignfeedback_editpdf\task\convert_submissions' Expected behaviour: conversion is successful Actual behaviour: you will see error Conversion failed with error:Could not find readonly pages for grade 37342
    • Affected Branches:
      MOODLE_35_STABLE
    • Pull 3.5 Branch:
      MDL-66250-wait-till-combined-is-ready-for-MOODLE_35_STABLE
    • Pull Master Branch:
      MDL-66250-wait-till-combined-is-ready-for-master

      Description

      When using async file converter https://github.com/catalyst/moodle-fileconverter_librelambda#libre-lambda-document-converter we run into issue when generating image for attempt is not fast enough which ends up with no page for readonly area, so this part of code looks not written properly:

       

      // If we are after the readonly pages...
      if ($readonly) {
          $filearea = self::PAGE_IMAGE_READONLY_FILEAREA;
          if ($fs->is_area_empty($contextid, $component, $filearea, $itemid)) {
              // We have a problem here, we were supposed to find the files.
              // Attempt to re-generate the pages from the combined images.
              self::generate_page_images_for_attempt($assignment, $userid, $attemptnumber);
              self::copy_pages_to_readonly_area($assignment, $grade);
          }
      }
      

      image is still being generating but code already tries to copy it to readonly area

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ilyatregubov Ilya Tregubov
              Reporter:
              ilyatregubov Ilya Tregubov
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 10 minutes
                  10m