-
Notifications
You must be signed in to change notification settings - Fork 198
Open
Description
metrics/metrics-util/src/registry/recency.rs
Lines 320 to 327 in 5b45a59
let deleted = if let Some((last_gen, last_update)) = entries.get_mut(key) { | |
// If the value is the same as the latest value we have internally, and | |
// we're over the idle timeout period, then remove it and continue. | |
if *last_gen == gen { | |
// If the delete returns false, that means that our generation counter is | |
// out-of-date, and that the metric has been updated since, so we don't | |
// actually want to delete it yet. | |
(now - *last_update) > idle_timeout && delete_op(registry, key) |
Would this piece of code run into race condition? Specifically, an update to the metric may happen before delete_op
, but we proceed to delete it anyway.
Metadata
Metadata
Assignees
Labels
No labels