YvCeung commented on code in PR #7903:
URL: https://github.com/apache/incubator-seata/pull/7903#discussion_r2777190876


##########
server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java:
##########
@@ -57,6 +59,8 @@ public class ClusterWatcherManager implements 
ClusterChangeListener {
 
     private static final Map<String, Long> GROUP_UPDATE_TERM = new 
ConcurrentHashMap<>();
 
+    private static final Map<Watcher<HttpContext>, Boolean> HTTP2_HEADERS_SENT 
= new ConcurrentHashMap<>();

Review Comment:
   There are already both proactive and passive cleanup mechanisms in place:
   Proactive cleanup – A scheduled task runs every second, iterates over all 
HTTP/2 watchers, and removes entries from HTTP2_HEADERS_SENT when the 
corresponding channel is inactive.
   Passive cleanup – Before sending a response, sendWatcherResponse checks 
whether the channel is still active; if not, it removes the watcher from 
HTTP2_HEADERS_SENT before returning.
   So the map is cleared both by the periodic scan and by the pre-send check, 
not only when channels become inactive in an event-driven way.



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