stczwd commented on a change in pull request #28129: [SPARK-31346][SQL]Add new 
configuration to make sure temporary directory cleaned
URL: https://github.com/apache/spark/pull/28129#discussion_r403807412
 
 

 ##########
 File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/SaveAsHiveFile.scala
 ##########
 @@ -140,7 +141,9 @@ private[hive] trait SaveAsHiveFile extends 
DataWritingCommand {
     try {
       createdTempDir.foreach { path =>
         val fs = path.getFileSystem(hadoopConf)
-        if (fs.delete(path, true)) {
+        // Sometimes (e.g., when speculative task is enabled), temporary 
directories may be
+        // left uncleaned, confirmTempDirDeleted can confirm deleteOnExit.
+        if (fs.delete(path, true) && !SQLConf.get.confirmTempDirDeleted) {
 
 Review comment:
   It is happened when running tasks is killed after Job committed, maybe the 
better way to solve this is checking the job's tasks status. However it seems 
it is impossible to check status here, thus I add new configuration to this.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to