Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

golang connection-refresh leaks clients #389

Open
igorbernstein2 opened this issue Oct 26, 2023 · 0 comments
Open

golang connection-refresh leaks clients #389

igorbernstein2 opened this issue Oct 26, 2023 · 0 comments
Labels
api: bigtable Issues related to the GoogleCloudPlatform/cloud-bigtable-examples API.

Comments

@igorbernstein2
Copy link
Contributor

igorbernstein2 commented Oct 26, 2023

The example tries to close the old client after a lameduckTime:
https://github.com/GoogleCloudPlatform/cloud-bigtable-examples/blob/main/go/connection-refresh/btrefresh/bigtable_rotator.go#L64-L68

However RotatingTable#client is only ever set when RotatingRable is constructed, and the new client is never set:
https://github.com/GoogleCloudPlatform/cloud-bigtable-examples/blob/main/go/connection-refresh/btrefresh/bigtable_rotator.go#L70

So the clean up routine will keep closing the same client, while leaking new ones.
Also when addressing this issue, care must be taken to capture the old client before the gorountine start

@product-auto-label product-auto-label bot added the api: bigtable Issues related to the GoogleCloudPlatform/cloud-bigtable-examples API. label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the GoogleCloudPlatform/cloud-bigtable-examples API.
Projects
None yet
Development

No branches or pull requests

1 participant