rzo1 commented on PR #1996: URL: https://github.com/apache/tomee/pull/1996#issuecomment-3128780675
> Hey All, > > First some insights on the design of ThreadContext and TheadContextListener. It was essentially created to be the "one thread local to rule them all" and eliminate the need for multiple thread locals. A ThreadContext is supposed to be thread-safe and not shared by multiple threads. On the surface with that design in mind, there should be no reason to have a ThreadLocal in a ThreadContextListener as is done on this PR. That's essentially putting a ThreadLocal on a ThreadLocal. If handling of the first thread local is broken and the ThreadContext is getting leaked, we'd want to fix that issue as it would be very serious. Said another way, we'd want to fix the first TheadLocal handling vs leaving it broken and adding more TheadLocals. > > @ammannmi @otbutz could you both subscribe to the dev list so we can talk this through there? [Subscribe](mailto:dev-subscr...@tomee.apache.org). I'll wait till tomorrow before starting a thread there so you have time to subscribe. Thanks for the details regarding the design :) - I've reverted the commit on main for now, so we can discuss the thing on the dev@ list in more detail. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomee.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org