AngersZhuuuu commented on a change in pull request #30139:
URL: https://github.com/apache/spark/pull/30139#discussion_r512729992



##########
File path: 
common/network-common/src/main/java/org/apache/spark/network/server/OneForOneStreamManager.java
##########
@@ -123,7 +125,10 @@ public void connectionTerminated(Channel channel) {
     for (Map.Entry<Long, StreamState> entry: streams.entrySet()) {
       StreamState state = entry.getValue();
       if (state.associatedChannel == channel) {
-        streams.remove(entry.getKey());
+        synchronized (lock) {
+          streams.remove(entry.getKey());

Review comment:
       > Is locking on `streams` not sufficient?
    
   Haven't thought of a particularly good solution to consistency and 
performance conflicts




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

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