MaxGekk commented on code in PR #49003:
URL: https://github.com/apache/spark/pull/49003#discussion_r1880654555


##########
sql/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteGrpcResponseSender.scala:
##########
@@ -223,7 +223,7 @@ private[connect] class ExecuteGrpcResponseSender[T <: 
Message](
       def streamFinished = 
executionObserver.getLastResponseIndex().exists(nextIndex > _)
       // 4. time deadline or size limit reached
       def deadlineLimitReached =
-        sentResponsesSize > maximumResponseSize || deadlineTimeMillis < 
System.currentTimeMillis()
+        sentResponsesSize > maximumResponseSize || deadlineTimeNs < 
System.nanoTime()

Review Comment:
   Comparing to `currentTimeMillis`, `nanoTime` can return a negative long, or 
in general, any number including the default value of `deadlineTimeNs` - 
Long.MaxValue. 



##########
sql/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteGrpcResponseSender.scala:
##########
@@ -53,7 +53,7 @@ private[connect] class ExecuteGrpcResponseSender[T <: 
Message](
   private var interrupted = false
 
   // Time at which this sender should finish if the response stream is not 
finished by then.
-  private var deadlineTimeMillis = Long.MaxValue

Review Comment:
   I think you cannot use `Long.MaxValue` as the default value anymore.



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