lokidundun commented on issue #7817:
URL: 
https://github.com/apache/incubator-seata/issues/7817#issuecomment-3592201696

   > - **Enhance HttpFilterContext to include request/response**
   > 
   > 1. Add a private final Object response field (to store Netty's 
FullHttpResponse, since Seata uses Netty for HTTP) and a getResponse() method.
   > 2. Introduce a ThreadLocal<HttpFilterContext<?>> to bind the context to 
the current thread, plus static methods getCurrentContext() (for external 
access like Spring AOP) and clearCurrentContext() (for lifecycle management).
   > 3. Update the constructor to accept the response parameter and bind the 
context to ThreadLocal during initialization.
   > 
   > - **Manage context lifecycle in HttpRequestFilterChain**
   > Add a finally block in the doFilter() method to call 
HttpFilterContext.clearCurrentContext(), preventing memory leaks (aligned with 
Dubbo's context cleanup logic).
   
   @funky-eyes this is my plan, what do you think, maybe this can be done after 
the pr #7818 merged.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to