Re: [PR] TOMEE-4516 - Threadsafe RequestScopedThreadContextL istener (tomee)

dblevins (via GitHub) <[email protected]>
Newsgroups gmane.comp.java.openejb.devel
Message-ID <PR_kwDOAHY68M6cr49w-56e6ea26-5bf2-46a4-96a2-77569991b5ae@gitbox.apache.org>
dblevins commented on PR #1996:
URL: https://github.com/apache/tomee/pull/1996#issuecomment-3128734986

   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:[email protected]).  I'll wait till tomorrow before starting a thread there so you have time to subscribe.
   
   
   
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.