Skip to content

fix: potential race conditions for metrics with no label constraints#1952

Open
denopink wants to merge 2 commits into
prometheus:mainfrom
denopink:patch-1
Open

fix: potential race conditions for metrics with no label constraints#1952
denopink wants to merge 2 commits into
prometheus:mainfrom
denopink:patch-1

Conversation

@denopink

@denopink denopink commented Feb 16, 2026

Copy link
Copy Markdown

@denopink

Copy link
Copy Markdown
Author

closes 1429
closes 1951

@denopink denopink changed the title fix: potential race conditions for metrics with no label constraint labels fix: potential race conditions for metrics with no label constraints Feb 17, 2026

@kakkoyun kakkoyun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution.

I would really appreciate if you could a test to actually replicate the reported race condition, to make sure we won't have any regressions in the future.

Comment thread prometheus/go_collector_metrics_go124_test.go
Comment thread prometheus/go_collector_metrics_go125_test.go
Comment thread prometheus/vec.go
Comment thread prometheus/vec.go
- fix: potential race conditions for metrics with no label constraints
   - Clone labels and label values in `func constrainLabels` and `func constrainLabels`
  - fix for prometheus#1951 and prometheus#1429

Signed-off-by: Owen Cabalceta <denopink@gmail.com>
@denopink

Copy link
Copy Markdown
Author

kakkoyun
I would really appreciate if you could a test to actually replicate the reported race condition, to make sure we won't have any regressions in the future.

Of course, I'll add it after work today or tomorrow morning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants