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


##########
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:
   done



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