-
Notifications
You must be signed in to change notification settings - Fork 491
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
bosun: Concurrent checks #1231
bosun: Concurrent checks #1231
Conversation
Will fix #1228 |
<-checkRunning | ||
return d, err | ||
} | ||
//TODO: This makes less sense with every alert running independently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can just be yanked as a feature. The reason I created it was so when someone "fixed" an alert, they didn't have to wait for it to return to normal. But because queries cover a time range, this is generally pretty futile. My idea to actually fix this problem is delayed close as described in #808
@gbrayut, I would love a thorough review on this if you don't mind. |
if s.notifications == nil { | ||
s.notifications = make(map[*conf.Notification][]*State) | ||
if s.pendingNotifications == nil { | ||
s.pendingNotifications = make(map[*conf.Notification][]*State) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not well versed in making maps or appending to them, but this smells like something that might need a lock or some other means of preventing duplicate assignments to the variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does require locking. Anywhere this function is called the lock should be held. We are really bad at specifying those kinds of conventions though. This should almost certainly not be exported if that is the case, and should probably note that.
077c1eb
to
dc0e51a
Compare
dc0e51a
to
40a9704
Compare
This modifies the schedule in many ways. Each alert runs in its own goroutine.