diff --git a/CHANGELOG.md b/CHANGELOG.md index 0532a102..56ad62bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [PR 85]: https://github.com/prometheus/client_rust/pull/85 [PR 96]: https://github.com/prometheus/client_rust/pull/96 +## [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/src/metrics/family.rs b/src/metrics/family.rs index c3cf6b9b..bb163761 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; @@ -223,11 +223,14 @@ impl> Family