Reviewed: https://reviews.mahara.org/7205 Committed: https://git.mahara.org/mahara/mahara/commit/bd5e7de413f3c6062891bc583eefcc25e2dd7fa0 Submitter: Robert Lyon (robe...@catalyst.net.nz) Branch: 16.10_STABLE
commit bd5e7de413f3c6062891bc583eefcc25e2dd7fa0 Author: Ghada El-Zoghbi <gh...@catalyst-au.net> Date: Mon Oct 24 17:59:09 2016 +1100 Bug #1636090: Increase execution time during fix for users during upgrade. Large Maharas with thousands of users run into max execution time errors. behatnotneeded Change-Id: Ie9d5e9d1edb6cd3682afb93e435ebb2d01be355e -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1636090 Title: Execution timeout during 16.10 upgrade when fixing broken user data Status in Mahara: Fix Committed Status in Mahara 16.10 series: Fix Committed Status in Mahara 17.04 series: Fix Committed Bug description: Mahara: 16.10.0 DB: Postgres OS: Linux Browser: FF While upgrading from 16.04 to 16.10, we are getting the following error: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/clients/mahara/htdocs/lib/mahara.php on line 1569 PHP Stack trace: PHP 1. {main}() /var/www/clients/mahara/htdocs/admin/cli/upgrade.php:0 PHP 2. upgrade_mahara() /var/www/clients/mahara/htdocs/admin/cli/upgrade.php:53 PHP 3. upgrade_core() /var/www/clients/mahara/htdocs/lib/mahara.php:265 PHP 4. xmldb_core_upgrade() /var/www/clients/mahara/htdocs/lib/upgrade.php:347 PHP 5. set_profile_field() /var/www/clients/mahara/htdocs/lib/db/upgrade.php:4733 PHP 6. safe_require() /var/www/clients/mahara/htdocs/lib/user.php:536 We have over 45K users in the DB and it's timing out. I've fixed it by adding the following immediately after 'if ($oldversion < 2016090206) {': $cur_max_execution_time = @ini_get('max_execution_time'); ini_set('max_execution_time', 0); And, at the end of the if statement (to set the time back to the original timeout): ini_set('max_execution_time', $cur_max_execution_time); I didn't use raise_time_limit(0) as it didn't seem to make a difference. It still timeout after 30 seconds. Thanks, Ghada To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1636090/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : mahara-contributors@lists.launchpad.net Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp