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
F18415626: D21583.id51380.diff
Sat, Aug 30, 9:50 AM
F18410577: D21583.id51380.diff
Sat, Aug 30, 5:06 AM
F18408850: D21583.id51388.diff
Sat, Aug 30, 3:09 AM
F18408433: D21583.id51388.diff
Sat, Aug 30, 2:40 AM
F18408135: D21583.diff
Sat, Aug 30, 2:09 AM
F18408070: D21583.diff
Sat, Aug 30, 2:05 AM
F18160499: D21583.id51388.diff
Fri, Aug 15, 2:02 AM
F18142474: D21583.id51380.diff
Thu, Aug 14, 12:24 PM
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