mridulm commented on a change in pull request #23590: [SPARK-26665][Core]Fix a 
bug that BlockTransferService.fetchBlockSync may hang forever
URL: https://github.com/apache/spark/pull/23590#discussion_r249378387
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/network/BlockTransferService.scala
 ##########
 @@ -107,10 +107,14 @@ abstract class BlockTransferService extends 
ShuffleClient with Closeable with Lo
             case e: EncryptedManagedBuffer =>
               result.success(e)
             case _ =>
-              val ret = ByteBuffer.allocate(data.size.toInt)
-              ret.put(data.nioByteBuffer())
-              ret.flip()
-              result.success(new NioManagedBuffer(ret))
+              try {
+                val ret = ByteBuffer.allocate(data.size.toInt)
+                ret.put(data.nioByteBuffer())
+                ret.flip()
+                result.success(new NioManagedBuffer(ret))
+              } catch {
+                case e: Throwable => result.failure(e)
 
 Review comment:
   Good point - it is required for the failure arg.
   But I dont like the throwable being ignored in the catch once failure is 
signalled.
   For example, interruption, OOM, thread death, etc - we should rethrow it 
once promise is updated.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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