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

Increase the log level for potential ThreadLocal leaks #6986

Open
jhsbeat opened this issue Jan 3, 2025 · 1 comment
Open

Increase the log level for potential ThreadLocal leaks #6986

jhsbeat opened this issue Jan 3, 2025 · 1 comment
Labels
Feature Request Suggest an idea for this project

Comments

@jhsbeat
Copy link

jhsbeat commented Jan 3, 2025

Is your feature request related to a problem? Please describe.
We've observed some ThreadLocal leaks due to the unclosed scope or close attempts in wrong order.
It makes really hard to figure out the cause when it works with opentelemetry java instrumentation because it's working as a shaded dependency and the log message level if FINE.
It's hard to implement a custom context storage when it comes with java instrumentation.

Describe the solution you'd like
I hope that it can be log the wrong attempts of closing the scope as ERROR or WARN level at least.

Describe alternatives you've considered
N?A

Additional context
N/A

@jhsbeat jhsbeat added the Feature Request Suggest an idea for this project label Jan 3, 2025
@trask
Copy link
Member

trask commented Jan 6, 2025

It makes really hard to figure out the cause when it works with opentelemetry java instrumentation because it's working as a shaded dependency

Have you tried -Dio.opentelemetry.javaagent.shaded.io.opentelemetry.context.enableStrictContext=true?

E.g. https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/e12ae9742b322f2e022843499687b6a9aa17ae5f/conventions/src/main/kotlin/otel.java-conventions.gradle.kts#L347

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

No branches or pull requests

2 participants