Skip to content

Conversation

@mxinden
Copy link
Member

@mxinden mxinden commented Oct 14, 2022

Releases #102 as prometheus-client v0.18.1.

Note that this targets the release-v0.18 branch and not master. Port to master is happening in a follow up.

//CC @nox

nox and others added 2 commits October 14, 2022 10:25
The method should not overwrite an existing key after it obtains the write lock.

Consider the following scenario with `Family<LabelSet, Gauge>` used by threads A and B:

1. A and B both call `family.get_or_insert(&label_set)`
2. A and B both acquire read lock and finds no key
3. A gets write lock and inserts a new gauge with value 0
4. A increments returned gauge to 1
5. B gets write lock and inserts a new gauge with value 0
6. B increments returned gauge to 1
7. A decrements gauge back to 0
8. B decrements gauge which now overflows to `u64::MAX`

Signed-off-by: Anthony Ramine <nox@nox.paris>
Signed-off-by: Max Inden <mail@max-inden.de>
@mxinden mxinden merged commit 6597abc into prometheus:release-v0.18 Oct 14, 2022
@mxinden
Copy link
Member Author

mxinden commented Oct 14, 2022

Tagged and published.

@mxinden
Copy link
Member Author

mxinden commented Oct 14, 2022

Also announcement on mailing list:

https://groups.google.com/g/prometheus-announce/c/BpXo9FoiP1E

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants