From de4c975710344f94810ec17652e96e9c5c1d86b2 Mon Sep 17 00:00:00 2001 From: Ashutosh Gupta Date: Mon, 30 May 2022 17:34:06 +0100 Subject: [PATCH] HADOOP-18238. Fix reentrancy check in SFTPFileSystem.close() (#4330) Contributed by Ashutosh Gupta Change-Id: I2742675add74259a93b3762a80c7ab5ee6d08c37 --- .../main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java index 297ec048e50..abfd24d68d0 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java @@ -709,11 +709,11 @@ public class SFTPFileSystem extends FileSystem { @Override public void close() throws IOException { - if (closed.getAndSet(true)) { - return; - } try { super.close(); + if (closed.getAndSet(true)) { + return; + } } finally { if (connectionPool != null) { connectionPool.shutdown();