cloud-fan commented on code in PR #42199:
URL: https://github.com/apache/spark/pull/42199#discussion_r1333767286


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/SQLExecution.scala:
##########
@@ -77,6 +79,11 @@ object SQLExecution {
     }
     val rootExecutionId = sc.getLocalProperty(EXECUTION_ROOT_ID_KEY).toLong
     executionIdToQueryExecution.put(executionId, queryExecution)
+    val originalInterruptOnCancel = 
sc.getLocalProperty(SPARK_JOB_INTERRUPT_ON_CANCEL)
+    if (originalInterruptOnCancel == null) {
+      val interruptOnCancel = 
sparkSession.conf.get(SQLConf.INTERRUPT_ON_CANCEL)
+      sc.setInterruptOnCancel(interruptOnCancel)

Review Comment:
   Looking at the API doc
   ```
     /**
      * Set the behavior of job cancellation from jobs started in this thread.
      *
      * @param interruptOnCancel If true, then job cancellation will result in 
`Thread.interrupt()`
      * being called on the job's executor threads. This is useful to help 
ensure that the tasks
      * are actually stopped in a timely manner, but is off by default due to 
HDFS-1208, where HDFS
      * may respond to Thread.interrupt() by marking nodes as dead.
      *
      * @since 3.5.0
      */
     def setInterruptOnCancel(interruptOnCancel: Boolean): Unit = {
       setLocalProperty(SparkContext.SPARK_JOB_INTERRUPT_ON_CANCEL, 
interruptOnCancel.toString)
     }
   ```
   
   This PR basically turns it on by default in Spark SQL, which is risky. Our 
internal test pipeline starts to fail with this change, due to file stream leak.
   
   I'm OK to add a config so that people can control it, but can we keep the 
behavior the same as before? (false by default)



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