-
Notifications
You must be signed in to change notification settings - Fork 440
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
Allow goroutines not launched by the tracer to stop on tracer.Stop() #3025
base: main
Are you sure you want to change the base?
Conversation
Datadog ReportBranch report: ❌ 1 Failed (0 Known Flaky), 5014 Passed, 71 Skipped, 2m 44.91s Total Time ❌ Failed Tests (1)
|
0692055
to
37b52f9
Compare
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.
LGTM. I left some small nits.
}) | ||
} | ||
|
||
func GetStopChan() chan struct{} { |
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.
func GetStopChan() chan struct{} { | |
func StopChan() chan struct{} { |
This would be a better name.
mu sync.Mutex | ||
) | ||
|
||
func InitStopChan() { |
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.
func InitStopChan() { | |
func Init() { |
Just in case this package evolves and needs to initialize more things beyond the stop chan.
What does this PR do?
contribroutines
, which contains astop
channel and an API for getting the channel and closing the channel. The contribs should get the channel to use as a stop condition for any goroutines they launch, and the tracer should be the only one to stop the channel.Motivation
We needed a way for the tracer to stop any goroutines that it does not directly manage on tracer.Stop(); without such a mechanism, we were dealing with runaway goroutines.
Reviewer's Checklist
v2-dev
branch and reviewed by @DataDog/apm-go.Unsure? Have a question? Request a review!