HomePhabricator

Prevent double mysqli close() after query timeout

Description

Prevent double mysqli close() after query timeout

Summary:
Ref T13149. I ran into this while double checking query timeout behavior for T13149.

After a query times out, we close the connection. We may then try to close the connection again in the destructor. Modern mysqli, at least, doesn't like this very much.

Instead, keep track of whether the connection needs to be closed or not.

Test Plan:

  • Ran a SELECT SLEEP(60) with a 3 second query timeout.
  • Before: query timeout exception, then second exception on double-close().
  • After: query timeout exception, then no second exception.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13149

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

Details

Provenance
epriestleyAuthored on Jun 5 2018, 12:58 PM
epriestleyPushed on Jun 7 2018, 6:40 PM
Reviewer
amckinley
Differential Revision
D19464: Prevent double mysqli close() after query timeout
Parents
rPHU20eff1c8d14f: Initial CloudWatch metric reporting support
Branches
Unknown
Tags
Unknown
Tasks
Unknown Object (Maniphest Task)
Build Status
Buildable 20384
Build 27681: Run Core Tests