You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cdkrot (via GitHub)" <gi...@apache.org> on 2023/08/09 13:37:05 UTC

[GitHub] [spark] cdkrot commented on a diff in pull request #42399: [SPARK-44721][CONNECT] Revamp retry logic and make retries run for 10 minutes

cdkrot commented on code in PR #42399:
URL: https://github.com/apache/spark/pull/42399#discussion_r1288496952


##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/connect/client/ExecutePlanResponseReattachableIterator.scala:
##########
@@ -297,6 +297,6 @@ class ExecutePlanResponseReattachableIterator(
   /**
    * Retries the given function with exponential backoff according to the client's retryPolicy.
    */
-  private def retry[T](fn: => T, currentRetryNum: Int = 0): T =
-    GrpcRetryHandler.retry(retryPolicy)(fn, currentRetryNum)
+  private def retry[T](fn: => T): T =
+    GrpcRetryHandler.retry(retryPolicy)(fn)

Review Comment:
   Wow, this is pretty complicated design in there. Can the code there be changed to just use ```GrpcRetryHandler.retry```?
   
   Something like
   ```
   GrpcRetryHandler.retry(retryPolicy)(() =>     new StreamObserver[proto.ReleaseExecuteResponse] {
         override def onNext(v: proto.ReleaseExecuteResponse): Unit = {}
         override def onCompleted(): Unit = {}
         override def onError(t: Throwable): Unit = throw t
   })



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org