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
    • Rank:
      38108

      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.

        Issue Links

          Activity

          Michael Aherne created issue -
          Michael Aherne made changes -
          Michael Aherne made changes -
          Michael de Raadt made changes -
          Fix Version/s STABLE backlog [ 10463 ]
          Labels patch triaged
          Michael Aherne made changes -
          Workaround Run command line script with set_time_limit disabled may help:

          php -d disabled_functions=set_time_limit upgrade.php
          Michael Aherne made changes -
          Workaround Run command line script with set_time_limit disabled may help:

          php -d disabled_functions=set_time_limit upgrade.php
          Running command line script with set_time_limit disabled may help:

          php -d disabled_functions=set_time_limit upgrade.php
          Michael Aherne made changes -
          Workaround Running command line script with set_time_limit disabled may help:

          php -d disabled_functions=set_time_limit upgrade.php
          Running command line script with set_time_limit disabled may help:

          php -d disable_functions=set_time_limit upgrade.php
          Petr Škoda made changes -
          Assignee Rajesh Taneja [ rajeshtaneja ] Petr Škoda (skodak) [ skodak ]
          Petr Škoda made changes -
          Status Open [ 1 ] Development in progress [ 3 ]
          Petr Škoda made changes -
          Status Development in progress [ 3 ] Waiting for integration review [ 10010 ]
          Pull Master Diff URL https://github.com/micaherne/moodle/commit/0571b627cd48284944443ae98ac38933af283c4d https://github.com/skodak/moodle/compare/master...w17_MDL-31553_m23_clitimeout
          Pull Master Branch MDL-31553-master w17_MDL-31553_m23_clitimeout
          Pull from Repository git://github.com/micaherne/moodle.git git://github.com/skodak/moodle.git
          Fix Version/s 2.1.6 [ 12052 ]
          Fix Version/s 2.2.3 [ 12053 ]
          Fix Version/s 2.3 [ 10657 ]
          Fix Version/s STABLE backlog [ 10463 ]
          Petr Škoda made changes -
          Priority Minor [ 4 ] Major [ 3 ]
          Eloy Lafuente (stronk7) made changes -
          Currently in integration Yes [ 10041 ]
          Dan Poltawski made changes -
          Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
          Integrator poltawski
          Dan Poltawski made changes -
          Status Integration review in progress [ 10004 ] Waiting for integration review [ 10010 ]
          Petr Škoda made changes -
          Dan Poltawski made changes -
          Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
          Dan Poltawski made changes -
          Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
          Fix Version/s 2.3 [ 10657 ]
          Michael de Raadt made changes -
          Tester rwijaya
          Michael Aherne made changes -
          Link This issue has been marked as being related by MDL-32607 [ MDL-32607 ]
          Rossiani Wijaya made changes -
          Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
          Rossiani Wijaya made changes -
          Status Testing in progress [ 10011 ] Tested [ 10006 ]
          Eloy Lafuente (stronk7) made changes -
          Status Tested [ 10006 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Currently in integration Yes [ 10041 ]
          Integration date 27/Apr/12

            People

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

              Dates

              • Created:
                Updated:
                Resolved: