question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Span not finished when subscription is cancelled

See original GitHub issue

Hello!

In the TracingOperator component is there any good reason the not finish the span when the wrapped source has been canceled?

I would change

class TracingOperator extends MonoOperator<Void, Void> {
    
    @Override
    public void subscribe(final CoreSubscriber<? super Void> subscriber) {
        // ...
        try (final Scope scope = tracer.scopeManager().activate(span)) {
            exchange.getAttributes().put(TracingWebFilter.SERVER_SPAN_CONTEXT, span.context());
            source.subscribe(new TracingSubscriber(subscriber, exchange, context, span, spanDecorators));
        }
    }

To

class TracingOperator extends MonoOperator<Void, Void> {
    
    @Override
    public void subscribe(final CoreSubscriber<? super Void> subscriber) {
        // ...
        try (final Scope scope = tracer.scopeManager().activate(span)) {
            exchange.getAttributes().put(TracingWebFilter.SERVER_SPAN_CONTEXT, span.context());
            source.doOnCancel(() -> span.finish())
               .subscribe(new TracingSubscriber(subscriber, exchange, context, span, spanDecorators));
        }
    }

Happy to contribute if needed!

Thanks.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
NHebrardcommented, Oct 14, 2020

Thanks for the new release!

1reaction
geoandcommented, Oct 13, 2020

Thanks for reminding me! Just launched it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug: Span has already been finished; will not be reported ...
This cancel event is picked up in the TracingClientResponseSubscriber subscription here. The end result is that the span is "finished" twice ...
Read more >
Terms of Service - Span Health
You may cancel your Subscription renewal either through your online account management page or by contacting Span Health Limited customer support team. A...
Read more >
How to cancel a PlayStation Store subscription
Go to Settings > Users and Accounts. · Select Account > Payment and Subscriptions > Subscriptions. · Select a service > Cancel Subscription....
Read more >
Cancel subscriptions | Stripe Documentation
After all settings are finalized, click Cancel subscription. By default, the cancellation takes effect immediately. As soon the subscription cancels, no ...
Read more >
TAP vs. SPAN: Which Option is Right for You? - Gigamon
Both situations can lead to dropped packets. SPANs work best for ad hoc monitoring of low volumes of data in locations where TAPs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found