-
Notifications
You must be signed in to change notification settings - Fork 161
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
Fix scoping bug for errors on collector service Run #194
Fix scoping bug for errors on collector service Run #194
Conversation
|
83eabc0
to
b6fa94f
Compare
collector/collector.go
Outdated
err = appErr | ||
} | ||
}() | ||
err := c.svc.Run(context.Background()) |
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.
Just curious, why is context.Background()
better than ctx
here?
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.
Good catch that should be the passed context. I was working off a older version that had no context passed to Run.
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.
Thanks for this change! It looks useful 🙂
simplify code
e6b1dfb
to
5518a90
Compare
Any update on getting this merged would like to use this instead of a fork. |
It's hard with people on holidays I guess, but I also would like to see this merged because I have ran into it too 😞 @codeboten think you could merge this when you have a chance? 🙂 |
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.
Thanks for fixing!
I had a tab error in my config yaml and the extension layer collector was hanging with no error output which led me to this bug.
The current logic will never receive the error returned from
appErr := c.svc.Run(ctx)
because error will be out of scope and the collector will hang. This creates a channel and assures we check the error. This allows us to get the config error.