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

IllegalArgumentException on BraveScopeManager.active().close() #73

Closed
hanson76 opened this issue Apr 10, 2018 · 1 comment
Closed

IllegalArgumentException on BraveScopeManager.active().close() #73

hanson76 opened this issue Apr 10, 2018 · 1 comment

Comments

@hanson76
Copy link

hanson76 commented Apr 10, 2018

The IllegalArgumentException that is being thrown in Scope#close() in ScopeManager#active()
is troublesome.
There are places where you either want to reuse an already active span, or create a new span if none exists. The opentracing API for Scope#close() does mention that it should end the active period of the thread and scope. I suggest that Scope#close() should be a no-op if the Scope is returned from ScopeManager#active() instead of throwing an exception.

An examples of this usage is the spring-web interfecptor in opentracing-contrib/java-spring-web [1]

[1] https://github.com/opentracing-contrib/java-spring-web/blob/master/opentracing-spring-web/src/main/java/io/opentracing/contrib/spring/web/interceptor/TracingHandlerInterceptor.java

@codefromthecrypt
Copy link
Contributor

Fixed by #74

PS I would not recommend using that instrumentation by the way, especially if you are using brave. The whole point of a bridge is that you can mix and match better things. There's no good reason to use ot-contrib for things like spring when brave's instrumentation is far more used and still lets you use OT apis for things that brave doesn't have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants