[wp-trac] [WordPress Trac] #13988: No Obvious Way to End Maitenance Mode / Problems Upgrading Large Plugins on 1and1

WordPress Trac wp-trac at lists.automattic.com
Sat Jun 19 10:43:27 UTC 2010


#13988: No Obvious Way to End Maitenance Mode / Problems Upgrading Large Plugins on
1and1
-----------------------------+----------------------------------------------
 Reporter:  layotte          |       Owner:                                   
     Type:  defect (bug)     |      Status:  new                              
 Priority:  normal           |   Milestone:  Unassigned                       
Component:  Upgrade/Install  |     Version:  3.0                              
 Severity:  normal           |    Keywords:  maitenance mode, plugins, upgrade
-----------------------------+----------------------------------------------

Comment(by sirzooro):

 Replying to [comment:4 dd32]:
 > > 3) The auto-upgrade/maintenance mode needs to die gracefully when an
 error occurs, such as a memory_limit is reached.
 >
 > Which is impossible to track, At the point that execution stops due to a
 fatal error, the script has stoped entirely, its not possible to continue
 from there

 When out of memory error occurs, PHP passes control to function installed
 using [http://php.net/set_error_handler set_error_handler()] call. I use
 it on one of my sites to send detailed error reports when some unexpected
 error happens. In case of out of memory error sometimes PHP has enough
 memory left, so my script is able to prepare error report and email it. Of
 course this happens only if there is still enough memory to prepare report
 and send it - otherwise PHP terminates my function.

 I think we can use `set_error_handler()` to install function which will
 end maintenance mode when out of memory (or other critical error) occurs.
 Of course in case of out of memory error it may not be able to finish
 work, but we should at least try to do it.

 We can also install recovery function via `set_exception_handler()` - it
 is called in PHP5+, after unhandled exception is thrown.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13988#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list