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
F13352253: D21583.diff
Sun, Jun 23, 12:09 PM
F13335918: D21583.diff
Wed, Jun 19, 3:43 AM
F13333838: D21583.id51380.diff
Tue, Jun 18, 12:12 PM
F13333837: D21583.id51388.diff
Tue, Jun 18, 12:12 PM
F13333836: D21583.id.diff
Tue, Jun 18, 12:11 PM
F13333807: D21583.diff
Tue, Jun 18, 11:36 AM
F13323394: D21583.diff
Fri, Jun 14, 5:39 PM
F13322605: D21583.diff
Fri, Jun 14, 10:23 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