-
Notifications
You must be signed in to change notification settings - Fork 19
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 #66: SpanObserver doesn't prevent execution on failure #67
Conversation
An error is logged, and execution will continue, including other SpanObservers registered to the Tracer.
@@ -252,7 +250,23 @@ public static synchronized SpanObserver unsubscribe(String name) { | |||
} | |||
|
|||
private static void computeObserversList() { | |||
observersList = ImmutableList.copyOf(observers.values()); | |||
Consumer<Span> newCompositeObserver = span -> { }; |
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.
If we're micro-optimising, why do we tolerate calling the empty observer first and calling andThen
on it?
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.
it's just a method invocation which is free compared to anything that does allocation (list iterator, for example).
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 can get rid of it, but I don't think it's worth the complexity since we won't be able to measure a difference.
Additional test coverage for palantir#66 & palantir#67 for when the async observer executor is shutdown.
<!-- PR title should start with '[fix]', '[improvement]' or '[break]' if this PR would cause a patch, minor or major SemVer bump. Omit the prefix if this PR doesn't warrant a standalone release. --> ## Before this PR <!-- Describe the problem you encountered with the current state of the world (or link to an issue) and why it's important to fix now. --> There was no unit test coverage for cases where the async observer executor was shutdown before spans completed. ## After this PR <!-- Describe at a high-level why this approach is better. --> Additional test coverage for #66 & #67 for when the async observer executor is shutdown. <!-- Reference any existing GitHub issues, e.g. 'fixes #000' or 'relevant to #000' -->
An error is logged, and execution will continue, including other
SpanObservers registered to the Tracer.