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

Race condition generating images for attempt

    XMLWordPrintable

    Details

      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

              • 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