Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use atomic field avoid (*AlertingRule).mtx wait when template expanding #10858

Merged

Conversation

hanjm
Copy link
Contributor

@hanjm hanjm commented Jun 11, 2022

Fix #10703

As the PR #10710 CI funcbench-status is broken and could not remove it, close the old one and open this PR.

Signed-off-by: hanjm <hanjinming@outlook.com>
Signed-off-by: hanjm <hanjinming@outlook.com>
Signed-off-by: hanjm <hanjinming@outlook.com>
Signed-off-by: hanjm <hanjinming@outlook.com>
Signed-off-by: hanjm <hanjinming@outlook.com>
@roidelapluie
Copy link
Member

cc @pracucci @aknuds1

@aknuds1
Copy link
Contributor

aknuds1 commented Jun 20, 2022

Started reviewing, not been able to finish yet.

Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM, @pracucci what do you think?

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Sorry for the late review, LGTM! FYI @roidelapluie

close(startQueryCh)
select {
case <-getDoneCh:
case <-time.After(time.Millisecond * 10):
Copy link
Contributor

Choose a reason for hiding this comment

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

This acts as a timeout, in case the other goroutines gets blocked reading properties from the AlertingRule. To avoid false positives on slow execution environments, I would significantly increase this timeout, to something like 1s.

@roidelapluie roidelapluie merged commit a5fea2c into prometheus:main Jul 19, 2022
@roidelapluie
Copy link
Member

Thanks!

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.

Performance: unexpected Rules API lock wait
4 participants