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

dispatch: fix race condition in dispatch test #1025

Merged
merged 1 commit into from
Oct 4, 2017

Conversation

brancz
Copy link
Member

@brancz brancz commented Oct 4, 2017

This fixes one of the (many) race conditions in the dispatch tests. As there are quite a few I was going to tackle them one by one. This one was a fairly obvious one.

@stuartnelson3 @fabxc

Copy link
Contributor

@stuartnelson3 stuartnelson3 left a comment

Choose a reason for hiding this comment

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

Question about having a non-struct member mutex: Locking in this situation prevents access/modification of which values?

@brancz
Copy link
Member Author

brancz commented Oct 4, 2017

It's just a race in the test itself, this is not actually a race in the Alertmanager code itself. But in order to one day run all tests with the -race flag, we'll also need to fix these :)

@brancz
Copy link
Member Author

brancz commented Oct 4, 2017

Sorry I don't think I understood your question in my previous comment. We're guarding reading/writing the last and current time variables.

@stuartnelson3 stuartnelson3 merged commit 5328885 into prometheus:master Oct 4, 2017
@brancz brancz deleted the dispatch-test-race branch October 4, 2017 16:05
hh pushed a commit to ii/alertmanager that referenced this pull request Aug 5, 2018
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