You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/12/17 02:54:05 UTC

[GitHub] [spark] LuciferYang commented on a change in pull request #33628: [SPARK-36406][CORE] Avoid unnecessary file operations before delete a write failed file held by DiskBlockObjectWriter

LuciferYang commented on a change in pull request #33628:
URL: https://github.com/apache/spark/pull/33628#discussion_r771069726



##########
File path: core/src/main/scala/org/apache/spark/storage/DiskBlockObjectWriter.scala
##########
@@ -272,6 +274,25 @@ private[spark] class DiskBlockObjectWriter(
     file
   }
 
+  /**
+   * Reverts write metrics that haven't been committed yet and delete the file held
+   * by current `DiskBlockObjectWriter`. Callers should invoke this function when there
+   * are runtime exceptions in file writing process and the file is no longer needed.
+   */
+  def closeAndDelete(): Unit = {

Review comment:
       `metrics` keeps the original logic now, but I also think it is wrong. I will give feedback later because there are other work to be done today.
   
   




-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org