LantaoJin commented on a change in pull request #24964: [SPARK-28160][CORE] Fix 
a bug that callback function may hang when unchecked exception missed
URL: https://github.com/apache/spark/pull/24964#discussion_r298240883
 
 

 ##########
 File path: 
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleClient.java
 ##########
 @@ -163,9 +163,16 @@ public void registerWithShuffleServer(
     client.sendRpc(removeBlocksMessage, new RpcResponseCallback() {
       @Override
       public void onSuccess(ByteBuffer response) {
-        BlockTransferMessage msgObj = 
BlockTransferMessage.Decoder.fromByteBuffer(response);
-        
numRemovedBlocksFuture.complete(((BlocksRemoved)msgObj).numRemovedBlocks);
-        client.close();
+        try {
+          BlockTransferMessage msgObj = 
BlockTransferMessage.Decoder.fromByteBuffer(response);
+          numRemovedBlocksFuture.complete(((BlocksRemoved) 
msgObj).numRemovedBlocks);
+        } catch (Exception e) {
 
 Review comment:
   I haven’t seen any error could occur here, so I use Exception. Throwable of 
course is fine.

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


With regards,
Apache Git Services

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

Reply via email to