kvtenant: properly release resources when reconnecting#106576
kvtenant: properly release resources when reconnecting#106576knz wants to merge 1 commit intocockroachdb:masterfrom
Conversation
|
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
|
Internal thread: https://cockroachlabs.slack.com/archives/C0KB9Q03D/p1689066956978959 |
Prior to this patch, the KV tenant connector could leak `grpc.ClientConn` objects across RPC errors and re-dials. This is because the KV tenant connector is more opinionated about "a working RPC connection" than our `rpc` package and wants to choose to abandon a RPC connection (and re-dial, possibly even a different server) *even when the `rpc` package considers the connection healthy because it responds to heartbeats*. This patch enhances the situation by more effectively closing the low-level `grpc.ClientConn` when the connector decides that it doesn't want to use it anymore. Release note: None
8633e20 to
503be25
Compare
|
I'm still unclear why this is the right thing to do. How sure are we that there aren't any callers of My decision tree as a reviewer would be the following:
Footnotes |
Commit extracted from #106414.
Epic: CRDB-26691
Prior to this patch, the KV tenant connector could leak
grpc.ClientConnobjects across RPC errors and re-dials. This isbecause the KV tenant connector is more opinionated about "a working
RPC connection" than our
rpcpackage and wants to choose to abandona RPC connection (and re-dial, possibly even a different server) even
when the
rpcpackage considers the connection healthy because itresponds to heartbeats.
This patch enhances the situation by more effectively closing
the low-level
grpc.ClientConnwhen the connector decides that itdoesn't want to use it anymore.
Release note: None