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

MDCAdapter implementation for virtual threads #917

Open
luvk1412 opened this issue Feb 4, 2025 · 0 comments
Open

MDCAdapter implementation for virtual threads #917

luvk1412 opened this issue Feb 4, 2025 · 0 comments

Comments

@luvk1412
Copy link

luvk1412 commented Feb 4, 2025

Current implementation of MDCAdapter in logback i.e. LogbackMDCAdapter relies on ThreadLocal. It is advised to not use ThreadLocal in case of Virtual threads. This article states Don't Cache Expensive Reusable Objects in Thread-Local Variables.

I was wondering if it's possible to design a new adapter which doesn't use ThreadLocal. If not possible currently at least I wanted to initiate a discussion around it as I currently don't see any. Was wondering if we can utilise ScopedValues JEP446 could be used in this case.

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

1 participant