phabricator.wikimedia.org

⚓ T102890 Use set_time_limit() to extend execution time on write requests

  • ️Wed Jun 17 2015

Use set_time_limit() to extend execution time on write requests

The HHVM timeout for MW appservers is very long (180 seconds). This is to reduce the chance of unnecessary termination of write requests. For unavoidable performance reasons, many write requests do work in multiple DB transactions, so termination of a write request can produce database inconsistency. And some administrative requests are essential, expensive, and have a very low request rate, such as RevisionDeleteUser. In both cases, server-side timeout can lead to a need for ops intervention.

I propose increasing the timeout of write requests at runtime, using set_time_limit(), so that the default HHVM timeout is not constrained by these use cases. Then the default HHVM timeout can be reduced to say 60 seconds, as suggested in T97204.

MW core could provide a static method or global function to call which notifies it of the beginning of a potentially long-running write request. Then the relevant special pages and extensions could call that function. The function would respond by calling set_time_limit() with a limit specified in the MW configuration. There should be a special configuration value which instructs MW to not call set_time_limit() at all, e.g. false.

Event Timeline

tstarling raised the priority of this task from to Needs Triage.

Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL · Credits