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
F14018101: D15781.diff
Tue, Nov 5, 4:40 AM
F14013949: D15781.id38048.diff
Sat, Nov 2, 8:04 PM
F14013057: D15781.id38048.diff
Sat, Nov 2, 12:00 AM
F14006662: D15781.diff
Mon, Oct 28, 3:00 PM
F13976039: D15781.id38020.diff
Fri, Oct 18, 12:37 PM
Unknown Object (File)
Wed, Oct 9, 10:18 AM
Unknown Object (File)
Oct 1 2024, 8:01 PM
Unknown Object (File)
Sep 12 2024, 8:28 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.