Homec4science

Support query timeouts with mysqli on the client side

Authored by epriestley <git@epriestley.com> on Apr 22 2016, 14:24.

Description

Support query timeouts with mysqli on the client side

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.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10849

Differential Revision: https://secure.phabricator.com/D15781

Details

Committed
epriestley <git@epriestley.com>Apr 25 2016, 20:19
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUb8058f6e29ba: Make setCWD() with bad paths safer
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU139d316c4484: Support query timeouts with mysqli on the client side (authored by epriestley <git@epriestley.com>).Apr 25 2016, 20:19