We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If prometheus reporter is used and and an invalid metrics name is supplied then the scope.Close goes into a deadlock.
scope.Close
Example code:
var reporter tally.CachedStatsReporter promReporter := tallyprom.NewReporter(tallyprom.Options{}) reporter = tallymulti.NewMultiCachedReporter(promReporter) scope, closer := tally.NewRootScope( tally.ScopeOptions{ Prefix: "test", Tags: map[string]string{}, CachedReporter: reporter, }, 1 * time.Second) defer closer.Close() // use the scope g := scope.Gauge("invalid-name") fmt.Println("gauge created")
The Println never gets called. Looking at the goroutine dump here's what happens
scope.Gauge acquires a write lock on the gauge mutex
scope.Gauge
prometheus reporter panics for an invalid gauge name
This causes the defers on the stack to be called including closer.Close()
closer.Close()
scope.Close() tries to acquire the lock again via reportRegistryWithLock
scope.Close()
reportRegistryWithLock
If defer closer.Close() is moved after calling scope.Gauge then the error is reported.
defer closer.Close()
One possible solution is to call gm.Unlock() using defer as well in scope.Gauge
gm.Unlock()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If prometheus reporter is used and and an invalid metrics name is supplied then the
scope.Close
goes into a deadlock.Example code:
The Println never gets called. Looking at the goroutine dump here's what happens
scope.Gauge
acquires a write lock on the gauge mutexprometheus reporter panics for an invalid gauge name
This causes the defers on the stack to be called including
closer.Close()
scope.Close()
tries to acquire the lock again viareportRegistryWithLock
If
defer closer.Close()
is moved after callingscope.Gauge
then the error is reported.One possible solution is to call
gm.Unlock()
using defer as well inscope.Gauge
The text was updated successfully, but these errors were encountered: