You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Please answer these questions before submitting a bug report.
What version of OpenCensus are you using?
v0.22.0
What version of Go are you using?
go1.13.6
What did you do?
I was running the new goleak tool on my codebase and ran into a leak coming from OpenCensus.
goleak: Errors on successful test run: found unexpected goroutines:
[Goroutine 37 in state select, with go.opencensus.io/stats/view.(*worker).start on top of the stack:
goroutine 37 [select]:
go.opencensus.io/stats/view.(*worker).start(0xc000143310)
/Users/adam/code/pkg/mod/go.opencensus.io@v0.22.0/stats/view/worker.go:154 +0x100
created by go.opencensus.io/stats/view.init.0
/Users/adam/code/pkg/mod/go.opencensus.io@v0.22.0/stats/view/worker.go:32 +0x57
]
What did you expect to see?
I expected no goroutine leaks in libraries I depend on.
What did you see instead?
A crash from goleaks.
Additional context
I'm pulling this library in via gocloud.dev/secretsv0.17.0, but that doesn't matter here since v0.22.0 of OpenCensus is used in both.
This appears to be coming from internal global state of a default recorder being set.
Please answer these questions before submitting a bug report.
What version of OpenCensus are you using?
v0.22.0What version of Go are you using?
go1.13.6What did you do?
I was running the new goleak tool on my codebase and ran into a leak coming from OpenCensus.
What did you expect to see?
I expected no goroutine leaks in libraries I depend on.
What did you see instead?
A crash from goleaks.
Additional context
I'm pulling this library in via gocloud.dev/secrets
v0.17.0, but that doesn't matter here sincev0.22.0of OpenCensus is used in both.This appears to be coming from internal global state of a default recorder being set.
https://github.com/census-instrumentation/opencensus-go/blob/v0.22.0/stats/view/worker.go#L30-L34
Also, there doesn't seem to be a way to retrieve this reporter to shutdown on application shutdown.
https://github.com/census-instrumentation/opencensus-go/search?q=DefaultRecorder&unscoped_q=DefaultRecorder