Skip to content

Conversation

@JoshRosen
Copy link
Contributor

@JoshRosen JoshRosen commented Sep 14, 2016

SPARK-8029 (#9610) modified shuffle writers to first stage their data to a temporary file in the same directory as the final destination file and then to atomically rename this temporary file at the end of the write job. However, this change introduced the potential for the temporary output file to be leaked if an exception occurs during the write because the shuffle writers' existing error cleanup code doesn't handle deletion of the temp file.

This patch avoids this potential cause of disk-space leaks by adding finally blocks to ensure that temp files are always deleted if they haven't been renamed.

@JoshRosen
Copy link
Contributor Author

When reviewing this change, it may help to look at the whitespace-free diff: https://github.com/apache/spark/pull/15104/files?w=0

@SparkQA
Copy link

SparkQA commented Sep 15, 2016

Test build #65403 has finished for PR 15104 at commit 82bceb3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@rxin
Copy link
Contributor

rxin commented Sep 15, 2016

cc @zsxwing

@zsxwing
Copy link
Member

zsxwing commented Sep 15, 2016

LGTM

@JoshRosen
Copy link
Contributor Author

I'm going to merge this to master and branch-2.0 and I'll also see whether it can be cleanly cherry-picked to branch-1.6.

asfgit pushed a commit that referenced this pull request Sep 15, 2016
SPARK-8029 (#9610) modified shuffle writers to first stage their data to a temporary file in the same directory as the final destination file and then to atomically rename this temporary file at the end of the write job. However, this change introduced the potential for the temporary output file to be leaked if an exception occurs during the write because the shuffle writers' existing error cleanup code doesn't handle deletion of the temp file.

This patch avoids this potential cause of disk-space leaks by adding `finally` blocks to ensure that temp files are always deleted if they haven't been renamed.

Author: Josh Rosen <[email protected]>

Closes #15104 from JoshRosen/cleanup-tmp-data-file-in-shuffle-writer.

(cherry picked from commit 5b8f737)
Signed-off-by: Josh Rosen <[email protected]>
asfgit pushed a commit that referenced this pull request Sep 15, 2016
SPARK-8029 (#9610) modified shuffle writers to first stage their data to a temporary file in the same directory as the final destination file and then to atomically rename this temporary file at the end of the write job. However, this change introduced the potential for the temporary output file to be leaked if an exception occurs during the write because the shuffle writers' existing error cleanup code doesn't handle deletion of the temp file.

This patch avoids this potential cause of disk-space leaks by adding `finally` blocks to ensure that temp files are always deleted if they haven't been renamed.

Author: Josh Rosen <[email protected]>

Closes #15104 from JoshRosen/cleanup-tmp-data-file-in-shuffle-writer.

(cherry picked from commit 5b8f737)
Signed-off-by: Josh Rosen <[email protected]>
@asfgit asfgit closed this in 5b8f737 Sep 15, 2016
@JoshRosen JoshRosen deleted the cleanup-tmp-data-file-in-shuffle-writer branch September 15, 2016 18:46
zzcclp pushed a commit to zzcclp/spark that referenced this pull request Sep 19, 2016
SPARK-8029 (apache#9610) modified shuffle writers to first stage their data to a temporary file in the same directory as the final destination file and then to atomically rename this temporary file at the end of the write job. However, this change introduced the potential for the temporary output file to be leaked if an exception occurs during the write because the shuffle writers' existing error cleanup code doesn't handle deletion of the temp file.

This patch avoids this potential cause of disk-space leaks by adding `finally` blocks to ensure that temp files are always deleted if they haven't been renamed.

Author: Josh Rosen <[email protected]>

Closes apache#15104 from JoshRosen/cleanup-tmp-data-file-in-shuffle-writer.

(cherry picked from commit 5b8f737)
Signed-off-by: Josh Rosen <[email protected]>
(cherry picked from commit 8646b84)
wgtmac pushed a commit to wgtmac/spark that referenced this pull request Sep 19, 2016
SPARK-8029 (apache#9610) modified shuffle writers to first stage their data to a temporary file in the same directory as the final destination file and then to atomically rename this temporary file at the end of the write job. However, this change introduced the potential for the temporary output file to be leaked if an exception occurs during the write because the shuffle writers' existing error cleanup code doesn't handle deletion of the temp file.

This patch avoids this potential cause of disk-space leaks by adding `finally` blocks to ensure that temp files are always deleted if they haven't been renamed.

Author: Josh Rosen <[email protected]>

Closes apache#15104 from JoshRosen/cleanup-tmp-data-file-in-shuffle-writer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants