-
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
Race condition with Exemplar in Counter #1145
Comments
fstab
added a commit
that referenced
this issue
Oct 7, 2022
Potential fix for #1145. Signed-off-by: Fabian Stäber <[email protected]>
PR for the trivial fix. I hope I'm not missing anything #1146. |
fstab
added a commit
that referenced
this issue
Oct 17, 2022
* Fix race condition with Exemplar in Counter Potential fix for #1145. Signed-off-by: Fabian Stäber <[email protected]> * Fix race condition with Exemplar in Counter Signed-off-by: Fabian Stäber <[email protected]> Signed-off-by: Fabian Stäber <[email protected]>
bwplotka
pushed a commit
that referenced
this issue
Nov 1, 2022
* Fix race condition with Exemplar in Counter Potential fix for #1145. Signed-off-by: Fabian Stäber <[email protected]> * Fix race condition with Exemplar in Counter Signed-off-by: Fabian Stäber <[email protected]> Signed-off-by: Fabian Stäber <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found an inconsistent concurrency behavior in
client_java
, and I think thatclient_golang
has the same issue. Here's the current implementation of the counter'sWrite()
function:Counter implements
selfCollector
. If I understand correctly, this means that the counter continues to be updated whileWrite()
is being called.So if an update happens after reading
val
but before readingexemplar
, you might see an examplar for an observation that's not represented inval
.I guess to fix this it would be sufficient to read
exemplar
first and thenval
, because then the worst case you get an exemplar for a previous observation, but you won't get an exemplar for a not-yet-existing observation.The text was updated successfully, but these errors were encountered: