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_r298241871
 
 

 ##########
 File path: 
common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java
 ##########
 @@ -237,11 +237,15 @@ public ByteBuffer sendRpcSync(ByteBuffer message, long 
timeoutMs) {
     sendRpc(message, new RpcResponseCallback() {
       @Override
       public void onSuccess(ByteBuffer response) {
-        ByteBuffer copy = ByteBuffer.allocate(response.remaining());
-        copy.put(response);
-        // flip "copy" to make it readable
-        copy.flip();
-        result.set(copy);
+        try {
+          ByteBuffer copy = ByteBuffer.allocate(response.remaining());
+          copy.put(response);
+          // flip "copy" to make it readable
+          copy.flip();
+          result.set(copy);
+        } catch (Throwable t) {
 
 Review comment:
   I will add a warning log.

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