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