-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HADOOP-16885. Encryption zone file copy failure leaks temp file ._COP… #1859
Conversation
…YING_ and wrapped stream.
...s-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
Show resolved
Hide resolved
private HdfsDataOutputStream safelyCreateWrappedOutputStream( | ||
DFSOutputStream dfsos) throws IOException { | ||
try { | ||
return dfs.createWrappedOutputStream(dfsos, statistics); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, it looks like HBASE-16062 is related.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does indeed
💔 -1 overall
This message was automatically generated. |
} finally { | ||
if (!direct) { | ||
deleteOnExit(target.path); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I need to be confident that we're handling is the situation where the file exists at the end, create fails with an overwrite error -we don't want the deleteOnExit to suddenly delete that previous file, not if it is one we care about.
For direct writes then: we don't do that delete (good), For indirect ones, we are relying on the fact that the file being created is temporary. Because we're going to end up stamping on it aren't we?
From an S3A perspective -I don't see the codepath creating a 404 as the deleteOnExit registration takes place after the upload has succeeded: the HEAD will find the file which has just been created.
shell-side changes LGTM. No opinion on the HDFS code |
I see @jojochuang approved, so +1 I've merged it in -thanks! |
see #1874; I hadn't noticed the hadoop-common test failure. Apologies all; if yetus is happy I'll commit it myself |
https://issues.apache.org/jira/browse/HADOOP-16885
Fix the leaking stream issues when access encrypted files hit exception during create.
Move the deleteOnExit to ensure the file get deleted cleanly.