-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
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
v1.12.0 race condition #968
Comments
Interesting 🤔 I do not recall any changes that could cause this. We'll look into it. |
Could you provide more about your current setup? OS? Arch? And the test command that you use? |
@kakkoyun Thank you for looking into this. The testing environment is:
I have pushed the failing version on the "dependencies" branch: You can test the prometheus package via the command:
|
I think the problem is that the newly implemented Go collector doesn't have a goroutine-safe
/cc @mknyszek |
Hm... |
But |
Right! Thanks. OK, that should be an easy fix. |
I would probably go for a simple mutex for now. If there are smarter solutions, we can implement them later. |
And yes, scraping can be assumed to be a relatively rare event (a few times a minute in usual cases, a few times a second in extreme cases). |
Sent PR #969. Tests now pass in |
When are you planning to release and tag this fix? |
After upgrading to: github.com/prometheus/client_golang v1.12.0
I am getting "WARNING: DATA RACE" while testing:
https://github.com/nexmoinc/gosrvlib/tree/main/pkg/metrics/prometheus
The race conditions do not appear in version 1.11.0 or any other previous version.
The race condition do not appear when disabling the t.Parallel() in the unit tests (e.g.: https://github.com/nexmoinc/gosrvlib/blob/main/pkg/metrics/prometheus/client_test.go#L153).
The relevant errors are:
The text was updated successfully, but these errors were encountered: