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

ScopeManagerShim.activate(span) throws IllegalArgumentException when null is passed in #3952

Closed
shawnsong opened this issue Dec 3, 2021 · 2 comments
Assignees
Labels
Bug Something isn't working

Comments

@shawnsong
Copy link
Contributor

ScopeManagerShim.activate() throws IllegalArgumentException if a null span is passed in. I'm not sure whether this is a bug or implemented on purpose but it is inconvenient to use as we need to do a null check before calling activate.

Currently, I need to do this to avoid the exception.

try (Scope scope = (span != null ? tracer.scopeManager().activate(span) : null)) {
  ...
}

It would be good if null is returned by the method as try-with-resources doesn't complain a null resource.

What version and what artifacts are you using?
Artifacts: (opentelemetry-opentracing-shim)
Version: (v1,9,1-alpha)

@carlosalberto
Copy link
Contributor

Fixed via #3985

@anpatellll
Copy link

@carlosalberto Whats the ETA of this being released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants