pengzhon-db commented on code in PR #41318:
URL: https://github.com/apache/spark/pull/41318#discussion_r1220432707
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -2597,6 +2600,50 @@ class SparkConnectPlanner(val session: SparkSession) {
.build())
}
+ /**
+ * A helper function to handle streaming awaitTermination().
awaitTermination() can be a long
+ * running command. In this function, we periodically check if the RPC call
has been cancelled.
+ * If so, we can stop the operation and release resources early.
+ * @param query the query waits to be terminated
+ * @param timeoutMs optional. Timeout to wait for termination. If None, no
timeout is set
+ * @return if the query has terminated
+ */
+ private def handleStreamingAwaitTermination(
+ query: StreamingQuery,
+ timeoutMs: Option[Long]): Boolean = {
+ // How often to check if RPC is cancelled and call awaitTermination()
+ val awaitTerminationIntervalMs = 10000
+
+ val hasTimeout = timeoutMs.isDefined
Review Comment:
removed
--
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]