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``` so we don't do the same thing 
twice?
   
   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: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to