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

Progress bar must declare NO_OUTPUT_BUFFERING

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      The easiest way to reproduce the problem is running this script:

      https://github.com/brendanheywood/moodle-tool_heartbeat/blob/master/progress.php

      Try it commenting out the NO_OUTPUT_BUFFERING, with debug developer enabled... you should get a debugging message.

      To check the behaviour on the affected files, you'll need some data to ensure that the progress takes long enough to execute.

      Example:
      1) Go to a subject
      2) Click import on the menu
      3) Select another subject that has enough data so the progress bar does not end too fast
      4) next next ...
      5) perform backup

      You should see the progress increasing slowing, before the patch it was hanging until completed

      You may want to repeat the test for the other affected files.

      Finally, ensure unit tests and behat tests are passing ok.

      Show
      The easiest way to reproduce the problem is running this script: https://github.com/brendanheywood/moodle-tool_heartbeat/blob/master/progress.php Try it commenting out the NO_OUTPUT_BUFFERING, with debug developer enabled... you should get a debugging message. To check the behaviour on the affected files , you'll need some data to ensure that the progress takes long enough to execute. Example: 1) Go to a subject 2) Click import on the menu 3) Select another subject that has enough data so the progress bar does not end too fast 4) next next ... 5) perform backup You should see the progress increasing slowing, before the patch it was hanging until completed You may want to repeat the test for the other affected files. Finally, ensure unit tests and behat tests are passing ok.
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull Master Branch:
      MDL-57809-34-progressbar

      Description

      We've found a couple prod issues which are because code is using the progress_bar() but not declaring NO_OUTPUT_BUFFERING first. So it just sits there until it's 100% and then loads without any progress. I've just done an audit and found a whole bunch of places that this affects.

      I think the solution is two fold:

      1) Fix the existing places to add NO_OUTPUT_BUFFERING - there are a couple places where the code is quite tangled which means this will be on for some pages that don't strictly need it, but there should be no downside here.

      2) We either throw an exception (master), or log a dev error (stables), if you attempt to render a progress bar and the buffering is on

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Jul/17