Execution timeout during 16.10 upgrade when fixing broken user data
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Ghada El-Zoghbi | ||
16.10 |
Fix Released
|
High
|
Ghada El-Zoghbi | ||
17.04 |
Fix Released
|
High
|
Ghada El-Zoghbi |
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/
PHP Stack trace:
PHP 1. {main}() /var/www/
PHP 2. upgrade_mahara() /var/www/
PHP 3. upgrade_core() /var/www/
PHP 4. xmldb_core_
PHP 5. set_profile_field() /var/www/
PHP 6. safe_require() /var/www/
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) {':
And, at the end of the if statement (to set the time back to the original timeout):
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
Patch for "master" branch: https:/ /reviews. mahara. org/7204