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

    https://github.com/apache/spark/pull/21346#discussion_r192566116
  
    --- Diff: 
common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java
 ---
    @@ -141,26 +141,14 @@ public void fetchChunk(
         StreamChunkId streamChunkId = new StreamChunkId(streamId, chunkIndex);
         handler.addFetchRequest(streamChunkId, callback);
     
    -    channel.writeAndFlush(new 
ChunkFetchRequest(streamChunkId)).addListener(future -> {
    --- End diff --
    
    Thanks for explaining. I guess the re-ordering of `channel.close()` and the 
`handler` operations is safe because the handler doesn't hold references to the 
channel / otherwise does not interact with it (and doesn't hold references to 
objects tied to channel lifecycle (like buffers))?


---

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

Reply via email to