jojochuang commented on a change in pull request #1859: HADOOP-16885. 
Encryption zone file copy failure leaks temp file ._COP…
URL: https://github.com/apache/hadoop/pull/1859#discussion_r384123762
 
 

 ##########
 File path: 
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
 ##########
 @@ -697,6 +700,20 @@ public FSDataOutputStream next(final FileSystem fs, final 
Path p)
     }.resolve(this, absF);
   }
 
+  // Private helper to ensure the wrapped inner stream is closed safely
+  // upon IOException throw during wrap.
+  // Assuming the caller owns the inner stream which needs to be closed upon
+  // wrap failure.
+  private HdfsDataOutputStream safelyCreateWrappedOutputStream(
+      DFSOutputStream dfsos) throws IOException {
+    try {
+      return dfs.createWrappedOutputStream(dfsos, statistics);
 
 Review comment:
   In fact, it looks like HBASE-16062 is related.

----------------------------------------------------------------
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