Skip to content

spanner: goleak reports a goroutine leak in spanner v1.91.0 #14488

@RoryQ

Description

@RoryQ

Client

e.g. Spanner

Environment

We have goleak configured for some test suites that use spanner, which have started failing since v1.91.0.

The endpointLatencyRegistry which was added starts a package-level runCleanup goroutine, and does not expose a way to opt out or stop, and it continues to run when all spanner clients are closed.

Is this expected behaviour that we now need to ignore in our goleak tests? Or do you have any other recommendation?

Code and Dependencies

lock_test.go:358: found unexpected goroutines:
    [Goroutine 41 in state select, with cloud.google.com/go/spanner.(*endpointLatencyRegistry).runCleanup on top of the stack:
    cloud.google.com/go/spanner.(*endpointLatencyRegistry).runCleanup(0xc0002f04d0)
    	/home/runner/go/pkg/mod/cloud.google.com/go/spanner@v1.91.0/endpoint_latency_registry.go:251 +0x24d
    created by cloud.google.com/go/spanner.newEndpointLatencyRegistry in goroutine 1
    	/home/runner/go/pkg/mod/cloud.google.com/go/spanner@v1.91.0/endpoint_latency_registry.go:83 +0x2df
    ]

Expected behavior

Spawned go routines should be stopped when no longer needed. And their lifecycle documented if needed throughout the lifecycle of the process.

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the Spanner API.triage meI really want to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions