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

    https://github.com/apache/spark/pull/18388#discussion_r128881079
  
    --- Diff: 
common/network-common/src/main/java/org/apache/spark/network/server/TransportRequestHandler.java
 ---
    @@ -130,11 +143,25 @@ private void processFetchRequest(final 
ChunkFetchRequest req) {
           return;
         }
     
    -    respond(new ChunkFetchSuccess(req.streamChunkId, buf));
    +    respond(new ChunkFetchSuccess(req.streamChunkId, 
buf)).addListener(future -> {
    +      streamManager.chunkSent(req.streamChunkId.streamId);
    +    });
       }
     
       private void processStreamRequest(final StreamRequest req) {
    +    if (logger.isTraceEnabled()) {
    +      logger.trace("Received req from {} to fetch stream {}", 
getRemoteAddress(channel),
    +        req.streamId);
    +    }
    +
    +    long chunksBeingTransferred = streamManager.chunksBeingTransferred();
    +    if (chunksBeingTransferred > maxChunksBeingTransferred) {
    +      logger.warn("The number of chunks being transferred {} is above {}, 
close the connection.",
    +        chunksBeingTransferred, maxChunksBeingTransferred);
    +      channel.close();
    +    }
    --- End diff --
    
    Also please decrease `chunksBeingTransferred` for when sending 
ChunkFetchFailure


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to