turboFei commented on code in PR #3315:
URL: https://github.com/apache/celeborn/pull/3315#discussion_r2134101126


##########
common/src/main/scala/org/apache/celeborn/common/util/Utils.scala:
##########
@@ -1282,24 +1282,30 @@ object Utils extends Logging {
 
   def withRetryOnTimeoutOrIOException[T](numRetries: Int, retryWait: 
Long)(block: => T): T = {
     var retriesLeft = numRetries
+
+    def waitOrThrow(e: Throwable): Unit = {
+      if (retriesLeft > 0) {
+        val retryWaitMs = new Random().nextInt(retryWait.toInt)
+        try {
+          TimeUnit.MILLISECONDS.sleep(retryWaitMs)
+        } catch {
+          case _: InterruptedException =>
+            throw e
+        }
+      } else {
+        throw e
+      }
+    }
+
     while (retriesLeft >= 0) {
       retriesLeft -= 1
       try {
         return block
       } catch {
+        case e: CelebornIOException if e.getCause != null && 
e.isInstanceOf[IOException] =>

Review Comment:
   
https://github.com/apache/celeborn/blob/60fa6d0ee786248b9f69c5c937f727884a4a3768/common/src/main/scala/org/apache/celeborn/common/exception/CelebornIOException.scala#L24-L25
   
   CelebornIOException is class of IOException and should be handled below.
   
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to