Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5743#discussion_r29515341
  
    --- Diff: 
network/common/src/main/java/org/apache/spark/network/server/OneForOneStreamManager.java
 ---
    @@ -80,12 +95,17 @@ public ManagedBuffer getChunk(long streamId, int 
chunkIndex) {
       }
     
       @Override
    -  public void connectionTerminated(long streamId) {
    -    // Release all remaining buffers.
    -    StreamState state = streams.remove(streamId);
    -    if (state != null && state.buffers != null) {
    -      while (state.buffers.hasNext()) {
    -        state.buffers.next().release();
    +  public void connectionTerminated(Channel channel) {
    +    // Close all streams which have been associated with the channel.
    +    for (Map.Entry<Long, StreamState> entry: streams.entrySet()) {
    +      StreamState state = entry.getValue();
    +      if (state.associatedChannel == channel) {
    +        streams.remove(entry.getKey());
    --- End diff --
    
    Making sense. Updated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to