GoogleCloudPlatform / GoogleCloudPlatform/cloud-bigtable-examples

golang connection-refresh leaks clients

Open
#389 0 comments 0 reactions 0 assignees View on GitHub
api: bigtable
Dominant language
Java
Stars
237
Forks
224
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.