HomePhabricator

Support query timeouts with mysqli on the client side

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

Provenance
epriestleyAuthored on Apr 22 2016, 12:24 PM
epriestleyPushed on Apr 25 2016, 6:19 PM
Reviewer
chad
Differential Revision
D15781: Support query timeouts with mysqli on the client side
Parents
rPHUb8058f6e29ba: Make setCWD() with bad paths safer
Branches
Unknown
Tags
Unknown
Tasks
T10849: Support query timeouts via `max_statement_time` or MYSLQI_ASYNC
Build Status
Buildable 11922
Build 14984: Run Core Tests