[
https://issues.apache.org/jira/browse/SPARK-36406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17392692#comment-17392692
]
Apache Spark commented on SPARK-36406:
--------------------------------------
User 'LuciferYang' has created a pull request for this issue:
https://github.com/apache/spark/pull/33628
> No longer do file truncate operation before delete a write failed file held
> by DiskBlockObjectWriter
> ----------------------------------------------------------------------------------------------------
>
> Key: SPARK-36406
> URL: https://issues.apache.org/jira/browse/SPARK-36406
> Project: Spark
> Issue Type: Improvement
> Components: Spark Core
> Affects Versions: 3.3.0
> Reporter: Yang Jie
> Priority: Minor
>
> We always do a file truncate operation(by
> DiskBlockObjectWriter.revertPartialWritesAndClose method) before delete a
> write failed file held by DiskBlockObjectWriter, a typical process is as
> follows
>
> {code:java}
> if (!success) {
> // This code path only happens if an exception was thrown above before we
> set success;
> // close our stuff and let the exception be thrown further
> writer.revertPartialWritesAndClose()
> if (file.exists()) {
> if (!file.delete()) {
> logWarning(s"Error deleting ${file}")
> }
> }
> }{code}
>
> This truncate operation seems unnecessary, we can add a new method to avoid
> do it.
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]