WweiL commented on code in PR #46819:
URL: https://github.com/apache/spark/pull/46819#discussion_r1625059530


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SessionHolder.scala:
##########
@@ -194,14 +195,16 @@ case class SessionHolder(userId: String, sessionId: 
String, session: SparkSessio
    */
   private[service] def interruptTag(tag: String): Seq[String] = {
     val interruptedIds = new mutable.ArrayBuffer[String]()
+    val queries = 
SparkConnectService.streamingSessionManager.getTaggedQuery(tag, session)
+    queries.foreach(_.query.stop())

Review Comment:
   I think the semantics of the interrupt is purely just interrupt but no wait:
   
https://github.com/apache/spark/blob/master/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SessionHolder.scala#L180-L188
   
   My understanding is that if there is some long running batch query (like in 
classic spark, do a spark.range(1e10) and it blocks the main thread, then we 
stop that execution, and don't care about the remaining additional remaining 
work).
   
   Then does it make sense to do something similar to the streaming query? 
Imagine the streaming query thread to be the main thread, and it is likely 
currently executing some microbatch that takes long, and we just send 
`interrupt` signal and ignores what is left over (cleanup, etc). 



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