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)
Sat, Dec 7, 11:44 AM
Unknown Object (File)
Thu, Dec 5, 5:44 PM
Unknown Object (File)
Nov 21 2024, 3:51 PM
Unknown Object (File)
Nov 16 2024, 7:47 PM
Unknown Object (File)
Nov 9 2024, 3:17 PM
Unknown Object (File)
Oct 22 2024, 5:27 AM
Unknown Object (File)
Oct 21 2024, 8:38 PM
Unknown Object (File)
Oct 20 2024, 6:26 AM
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.