Skip to content

constHistogram write cause "concurrent map iteration and map write" panic #948

Answered by beorn7
sunlintong asked this question in Q&A
Discussion options

You must be logged in to vote

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 a Collect call is a race.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kakkoyun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #947 on December 14, 2021 12:53.