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

fix #66: SpanObserver doesn't prevent execution on failure #67

Merged
merged 1 commit into from
Feb 7, 2019

Conversation

carterkozak
Copy link
Contributor

An error is logged, and execution will continue, including other
SpanObservers registered to the Tracer.

An error is logged, and execution will continue, including other
SpanObservers registered to the Tracer.
@carterkozak carterkozak requested a review from a team as a code owner February 7, 2019 17:55
@@ -252,7 +250,23 @@ public static synchronized SpanObserver unsubscribe(String name) {
}

private static void computeObserversList() {
observersList = ImmutableList.copyOf(observers.values());
Consumer<Span> newCompositeObserver = span -> { };
Copy link
Contributor

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?

Copy link
Contributor Author

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).

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 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.

@bulldozer-bot bulldozer-bot bot merged commit 81dd905 into develop Feb 7, 2019
@bulldozer-bot bulldozer-bot bot deleted the ckozak/gh66 branch February 7, 2019 18:17
schlosna added a commit to schlosna/tracing-java that referenced this pull request Mar 29, 2019
Additional test coverage for palantir#66 & palantir#67 for when the async observer
executor is shutdown.
bulldozer-bot bot pushed a commit that referenced this pull request Mar 29, 2019
<!-- 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' -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants