Moodle
  1. Moodle
  2. MDL-31553

max_execution_time lowered during command line upgrade

    Details

    • Database:
      MySQL
    • Testing Instructions:
      Hide

      Create a test script in the root of the Moodle installation with the following code. Run it with the PHP command line interpreter. Should output "Pass" if the upgrade_set_timeout function does not alter the default max_execution_time.

      <?php
      define('CLI_SCRIPT', true);
      require_once 'config.php';
      $CFG->upgraderunning = time() + 3600;
      upgrade_set_timeout();
      echo ini_get('max_execution_time') == 0 ? "Pass" : "Fail";
      unset_config('upgraderunning'); // Clean up

      Show
      Create a test script in the root of the Moodle installation with the following code. Run it with the PHP command line interpreter. Should output "Pass" if the upgrade_set_timeout function does not alter the default max_execution_time. <?php define('CLI_SCRIPT', true); require_once 'config.php'; $CFG->upgraderunning = time() + 3600; upgrade_set_timeout(); echo ini_get('max_execution_time') == 0 ? "Pass" : "Fail"; unset_config('upgraderunning'); // Clean up
    • Workaround:
      Hide

      Running command line script with set_time_limit disabled may help:

      php -d disable_functions=set_time_limit upgrade.php

      Show
      Running command line script with set_time_limit disabled may help: php -d disable_functions=set_time_limit upgrade.php
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w17_MDL-31553_m23_clitimeout

      Description

      During long-running command line upgrades (particularly from Moodle 1.9 to 2) it is possible to get the following error: "Fatal error: Maximum execution time of 300 seconds exceeded". This should not happen as the PHP CLI interface is hard-coded to set max_execution_time to 0 (unlimited) regardless of the php.ini setting.

        Gliffy Diagrams

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: