diff --git a/CHANGELOG.md b/CHANGELOG.md index 1822983..a17c710 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.18.1] + +### Fixed + +- Fix race condition in `Family::get_or_create`. See [PR 102]. + +[PR 102]: https://github.com/prometheus/client_rust/pull/102 + ## [0.18.0] ### Changed diff --git a/Cargo.toml b/Cargo.toml index a114a05..41ba9dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "prometheus-client" -version = "0.18.0" +version = "0.18.1" authors = ["Max Inden "] edition = "2021" description = "Open Metrics client library allowing users to natively instrument applications." diff --git a/src/metrics/family.rs b/src/metrics/family.rs index fb5dbeb..63d13f3 100644 --- a/src/metrics/family.rs +++ b/src/metrics/family.rs @@ -3,7 +3,7 @@ //! See [`Family`] for details. use super::{MetricType, TypedMetric}; -use parking_lot::{MappedRwLockReadGuard, RwLock, RwLockReadGuard}; +use parking_lot::{MappedRwLockReadGuard, RwLock, RwLockReadGuard, RwLockWriteGuard}; use std::collections::HashMap; use std::sync::Arc; @@ -222,11 +222,14 @@ impl> Family