This is an automated email from the ASF dual-hosted git repository. stevel pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push: new cf9559eb27f1 HADOOP-19073 WASB: Fix connection leak in FolderRenamePending (#6534) cf9559eb27f1 is described below commit cf9559eb27f142b7b9eadee2fcd3a326aa81582d Author: xuzifu666 <1206332...@qq.com> AuthorDate: Wed May 15 21:38:06 2024 +0800 HADOOP-19073 WASB: Fix connection leak in FolderRenamePending (#6534) Contributed by xuyu --- .../java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java index 45fbf791908a..4e777da8b409 100644 --- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java +++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java @@ -160,9 +160,12 @@ public class NativeAzureFileSystem extends FileSystem { // open redo file Path f = redoFile; - FSDataInputStream input = fs.open(f); - byte[] bytes = new byte[MAX_RENAME_PENDING_FILE_SIZE]; - int l = input.read(bytes); + int l; + byte[] bytes; + try (FSDataInputStream input = fs.open(f)) { + bytes = new byte[MAX_RENAME_PENDING_FILE_SIZE]; + l = input.read(bytes); + } if (l <= 0) { // Jira HADOOP-12678 -Handle empty rename pending metadata file during // atomic rename in redo path. If during renamepending file is created --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org