Page MenuHomePhabricator

Prevent double mysqli close() after query timeout
ClosedPublic

Authored by epriestley on Jun 5 2018, 1:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 2:56 AM
Unknown Object (File)
Wed, Apr 17, 3:22 PM
Unknown Object (File)
Thu, Apr 4, 7:43 PM
Unknown Object (File)
Sun, Mar 31, 3:47 PM
Unknown Object (File)
Sun, Mar 31, 3:47 PM
Unknown Object (File)
Sun, Mar 31, 3:47 PM
Unknown Object (File)
Sun, Mar 31, 3:47 PM
Unknown Object (File)
Mar 26 2024, 7:01 PM
Subscribers
None

Details

Reviewers
amckinley
Maniphest Tasks
Unknown Object (Maniphest Task)
Commits
rPHU4d341cfcc51c: 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.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley mentioned this in Unknown Object (Maniphest Task).Jun 5 2018, 1:05 PM
This revision is now accepted and ready to land.Jun 5 2018, 10:03 PM
This revision was automatically updated to reflect the committed changes.