Skip to content

golang connection-refresh leaks clients #389

@igorbernstein2

Description

@igorbernstein2

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigtableIssues related to the GoogleCloudPlatform/cloud-bigtable-examples API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions