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();