-
Notifications
You must be signed in to change notification settings - Fork 103
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
Rungroup improvements: logging #1316
Conversation
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 is really good! I think it may just need some tests to be shippable.
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 think it's fine. I think it's pulling in a lot of weird cruft from the original, but we can iterate in subsequent steps
pkg/rungroup/rungroup.go
Outdated
// Signal all actors to stop. | ||
for _, a := range g.actors { | ||
level.Debug(g.logger).Log("msg", "interrupting actor", "actor", a.name) | ||
a.interrupt(err.err) |
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.
Do we want to pass nil
here? or leave that for future work?
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 don't feel strongly about it -- I'd been erring on the side of not adjusting any logic for now
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.
legit!
// Wait for all actors to stop. | ||
for i := 1; i < cap(errors); i++ { | ||
e := <-errors | ||
level.Debug(g.logger).Log("msg", "successfully interrupted actor", "actor", e.errorSourceName, "index", i) | ||
} |
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 know that this is a copy from the original, but this is a weird idiom. Feels like wait groups would be more sensible (if harder to add logging for). Eh, maybe we leave it and adjust later?
Relates to #1205
Builds on oklog/rungroup to add logging, making it possible to identify which actors are not shutting down in a timely manner.