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.

ThreadLocalActiveSpan.deactivate()

See original GitHub issue

ThreadLocalActiveSpan.deactivate() does not deactivate/finish span when it is not currently active span: https://github.com/opentracing/opentracing-java/blob/master/opentracing-util/src/main/java/io/opentracing/util/ThreadLocalActiveSpan.java#L50

Problems:

  • response interceptors sometimes run in a different thread, therefore it makes it impossible to deactivate the span (e.g. async jax-rs)
  • if a user accidentally does not deactivate local span, span created by instrumentation is not finished

I would like to see what others think and what issues they faced.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
rbtcollinscommented, Oct 8, 2017

I came here tracking a span leak in test code - using MockTracer w/ThreadLocalActiveSpanSource - even without threads the current code has some fragility.

What I have going on is clearly a misuse of the API - and I’m going to be tracking that down now - but the silent leak was much less helpful than we could be.

I’d like to see an exception raised, or a diagnostic stacktrace logged or some such thing: leaking is pretty much the most difficult thing to deal with: its silent, it will cause traces to have bad parents and possibly even join distinct traces together.

0reactions
carlosalbertocommented, Jun 24, 2018

Trying to prevent this Issue to become stale, a pair of things:

  1. Once we implement some kind of Observer API, this kind of things could at least be reported to the user.
  2. With the old 0.30 API it seemed to be much more of a problem - as we haven’t been getting reports about this behavior with the new 0.31 one.

Unless somebody thinks this is still an issue, I will close it by the end of the next week. Let us know 😉

@pavolloffay @rbtcollins

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to leave/exit/deactivate a Python virtualenv - Stack Overflow
Just type "workon" with no arguments and hit enter. The command to leave is "deactivate", as answered below. – Dannid. Oct 7, 2014...
Read more >
ActiveSpan (io.opentracing:opentracing-v030 0.0.4 API) - mvndoc.com
Mark the end of the active period for the current thread and ActiveSpan . When the last ActiveSpan is deactivated for a given...
Read more >
BaseSpan (io.opentracing:opentracing-v030 0.0.4 API) - Javadoc ...
For those, either use Span.finish() or ActiveSpan.deactivate() depending on the programming model. See Also: Span , ActiveSpan , Tracer.SpanBuilder.
Read more >
Activate, Reactivate, Deactivate your Virtualenv - Blog Post
Here's a quick guide to activate your virtual environment (Virtualenv) -- especially if you closed your terminal window (aka command prompt) ...
Read more >
io.opentracing.ActiveSpan - Java Code Examples and tutorials
currentTimeMillis(), log(event. ... deactivate(); break; case EXECUTE_SUCCESS: deactivate(); break; ... ThreadLocalActiveSpan)6 Path (java.nio.file.
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