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 tracer components to be cleanly restarted after shutdown #1177
Conversation
@@ -56,7 +56,10 @@ def logger | |||
end | |||
|
|||
def shutdown! | |||
components.shutdown! if instance_variable_defined?(:@components) && @components | |||
if instance_variable_defined?(:@components) && @components |
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.
should this change be in a different PR?
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 the important change, I updated the description of the PR to match.
I think a commit slipped in here unrelated, otherwise lgtm and thanks for tracking this down, these flaky tests have been killing us |
@ericmustin I removed the test fix, and kept the important change regarding tracer shutdown. |
We have inconsistent behaviour with
Configuration#shutdown!
where we shut down our components object (components.shutdown!
), but we keep its lingering instance in an instance variable (@components
), with partially living references.This prevented us from ever being able to restart the tracer, only ever returning dirty instances of the tracer on every call to
Datadog.tracer
after a shutdown.This PR now allows the tracer components to be cleanly
shutdown!
and restarted, without lingering references.