juliuszsompolski commented on code in PR #45150:
URL: https://github.com/apache/spark/pull/45150#discussion_r1913310090


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteGrpcResponseSender.scala:
##########
@@ -201,9 +237,18 @@ private[connect] class ExecuteGrpcResponseSender[T <: 
Message](
           // The state of interrupted, response and lastIndex are changed 
under executionObserver
           // monitor, and will notify upon state change.
           if (response.isEmpty) {
-            val timeout = Math.max(1, deadlineTimeMillis - 
System.currentTimeMillis())
+            // Wake up more frequently to send the progress updates.
+            val progressTimeout =
+              
executeHolder.sessionHolder.session.conf.get(CONNECT_PROGRESS_REPORT_INTERVAL)
+            // If the progress feature is disabled, wait for the deadline.
+            val timeout = if (progressTimeout > 0) {
+              progressTimeout
+            } else {
+              Math.max(1, deadlineTimeMillis - System.currentTimeMillis())
+            }

Review Comment:
   nit:
   ```
               var timeout = Math.max(1, deadlineTimeMillis - 
System.currentTimeMillis())
               // Wake up more frequently to send the progress updates.
               val progressTimeout =
                 
executeHolder.sessionHolder.session.conf.get(CONNECT_PROGRESS_REPORT_INTERVAL)
               if (progressTimeout > 0) {
                 Math.min(progressTimeout, timeout)
               }
   ```
   otherwise, progressTimeout may make us wait beyond the deadline.



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to