-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Remove and ban usage of [Inheritable]ThreadLocal
#463
Comments
Reopening since #589 will be reverted soon. |
A few datapoints: https://quarkus.io/guides/duplicated-context:
https://quarkus.io/guides/context-propagation:
|
Thanks for filing this issue. IIUC, the community has agreed on replacing cc @snazy @jbonofre @adutra @dimas-b @collado-mike @eric-maynard @dennishuo @HonahX |
My fear is that the issues caused by the ThreadLocal may be very subtle -- e.g. one client gets another client's cache by accident. Maybe these issues are occurring, but they have gone unnoticed. Or maybe there are no issues now, but a PR will introduce an issue soon. I really hope that we can resolve this prior to 1.0. |
@flyrain @eric-maynard : previous attempt at removing thread locals by @adutra (#589) was reverted in #1000. How do you envision organizing the work on implementing this issue to avoid a similar situation? |
It's a good question. Ideally, any interface changes can be either minimal or purely additive (i.e. CallContext is added to interfaces, nothing is removed) so that the fix can be focused on removing threadlocal rather than also removing CallContext. Now that I am more familiar with Quarkus, I also feel that CallContext needs a refactor and that we have a few too many disjoint beans managed by CDI. But I would suggest that we decouple this work from the ThreadLocal work to keep the ThreadLocal removal as uncontroversial and as unlikely to disrupt existing deployments as possible. |
@eric-maynard : I'm not sure we can completely avoid changing method parameters while removing thread locals because the information currently obtained from they will have to be provided by other means (CDI or direct call parameters). Because of downstream dependencies, I'd prefer you to tackle thread locals. However, if you prefer I can have a go at it and tag you for a review... WDYT? |
Thanks @dimas-b for picking this up. Assigned this to you. Let's discuss on the PR once it's ready. |
@flyrain : Thanks for your trust, but I did not pick it up... My question to @eric-maynard above did not get an answer yet ;) |
@dimas-b, sorry for the miss understanding, un-assigned, feel free to pick up later. |
This is a serious 1.0-blocker, see reason explained here |
Hey @dimas-b, I can try to pick this up. |
Is this a possible security vulnerability?
Describe the bug
While
[Inheritable]ThreadLocal
s are relatively easy to start with to pass along request related information,ThreadLocal
s come with a non-negligible cost and maintenance burden:The proper way of sharing request related information is to use CDI's
@RequestScoped
beans.To Reproduce
No response
Actual Behavior
No response
Expected Behavior
No response
Additional context
No response
System information
No response
The text was updated successfully, but these errors were encountered: