Page MenuHomePhabricator

When a GlobalLock with an external connection is released, don't return it to the pool
ClosedPublic

Authored by epriestley on Mar 2 2021, 8:49 PM.
Tags
None
Referenced Files
F13180461: D21583.id51388.diff
Thu, May 9, 12:03 AM
Unknown Object (File)
Mon, May 6, 10:40 AM
Unknown Object (File)
Fri, May 3, 6:39 AM
Unknown Object (File)
Mon, Apr 29, 7:31 PM
Unknown Object (File)
Thu, Apr 25, 1:16 AM
Unknown Object (File)
Thu, Apr 25, 1:14 AM
Unknown Object (File)
Sat, Apr 20, 5:36 PM
Unknown Object (File)
Thu, Apr 11, 8:49 AM
Subscribers
None

Details

Summary

Ref T13627. Currently, global locks always return connections (even external connections) to the connection pool when unlocked.

This code is obviously buggy: isExternalConnection is set to false immediately before it is tested. This bug has existed since this code was introduced, in D15792.

  • Instead of storing a flag, store the actual connection.
  • Don't clear it when unlocking.
  • Don't return external connections to the pool.
Test Plan
  • Added a failing test, made it pass.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable