constHistogram write cause "concurrent map iteration and map write" panic #948
-
version: v1.11.0
The code may be here: client_golang/prometheus/histogram.go Lines 554 to 577 in 8184d76 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I think this may happens when " |
Beta Was this translation helpful? Give feedback.
-
Indeed, the observed behavior is expected. |
Beta Was this translation helpful? Give feedback.
Indeed, the observed behavior is expected.
NewConstHistogram
creates a "throw-away" histogram for one-time use (that's what the "constant" in the name tries to allude to). Changing the buckets map after you have handed over the histogram in aCollect
call is a race.