Page MenuHomePhabricator

Support query timeouts with mysqli on the client side
ClosedPublic

Authored by epriestley on Apr 21 2016, 11:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 8:17 AM
Unknown Object (File)
Fri, Nov 22, 12:54 AM
Unknown Object (File)
Mon, Nov 18, 12:45 PM
Unknown Object (File)
Thu, Nov 14, 3:33 AM
Unknown Object (File)
Wed, Nov 13, 4:39 PM
Unknown Object (File)
Sun, Nov 10, 5:41 AM
Unknown Object (File)
Tue, Nov 5, 8:47 PM
Unknown Object (File)
Tue, Nov 5, 6:43 AM
Subscribers
None

Details

Summary

Ref T10849. I'm going to wait for the release cut to pursue this since it's the kind of change that could cause weird stuff to happen, but it appears to work properly.

To execute a query with a timeout, we use the MySQLi "async" API, and just resolve the query synchronously inline. This lets us throw if too much time has passed.

Test Plan
  • Added a SELECT SLEEP(10) on the home page.
  • Set a 3 second query timeout.
  • Saw the query abort properly after a few seconds.
  • Browsed around normally to test SELECT, etc.
  • Created some objects to test INSERT, UPDATE, etc.

Diff Detail

Event Timeline

epriestley retitled this revision from to Support query timeouts with mysqli on the client side.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.

(This change also does nothing on its own, it needs a corresponding change to Phabricator to call setQueryTimeout(...) before it activates.)

chad edited edge metadata.
This revision is now accepted and ready to land.Apr 22 2016, 12:41 AM
This revision was automatically updated to reflect the committed changes.