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

Race condition generating images for attempt

XMLWordPrintable

    • MOODLE_35_STABLE
    • MDL-66250-wait-till-combined-is-ready-for-master
    • 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

      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

       

            Unassigned Unassigned
            ilyatregubov Ilya Tregubov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

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

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