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

Rungroup improvements: logging #1316

Merged
merged 7 commits into from
Sep 5, 2023

Conversation

RebeccaMahany
Copy link
Contributor

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.

Copy link
Contributor

@James-Pickett James-Pickett left a 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.

@RebeccaMahany RebeccaMahany marked this pull request as ready for review August 30, 2023 20:49
Copy link
Contributor

@directionless directionless left a 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

// 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)
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

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

legit!

Comment on lines +68 to +72
// 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)
}
Copy link
Contributor

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?

@RebeccaMahany RebeccaMahany merged commit eb3f14f into kolide:main Sep 5, 2023
@RebeccaMahany RebeccaMahany deleted the becca/rungroup branch September 5, 2023 14:15
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.

3 participants