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)
Wed, Mar 27, 4:44 PM
Unknown Object (File)
Wed, Mar 27, 3:47 PM
Unknown Object (File)
Wed, Mar 27, 2:12 PM
Unknown Object (File)
Sun, Mar 10, 9:31 PM
Unknown Object (File)
Feb 19 2024, 9:41 AM
Unknown Object (File)
Jan 29 2024, 12:04 AM
Unknown Object (File)
Jan 26 2024, 9:24 AM
Unknown Object (File)
Dec 27 2023, 6:51 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

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.