From 21fa693d38a0ea684899ac12729e1785f95e622f 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 --- .../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 46b829f14a..3260a0db51 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 FileStatus getFileStatus(Path f) throws IOException { @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();