You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by st...@apache.org on 2022/05/30 16:34:22 UTC

[hadoop] branch trunk updated: HADOOP-18238. Fix reentrancy check in SFTPFileSystem.close() (#4330)

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 21fa693d38a HADOOP-18238. Fix reentrancy check in SFTPFileSystem.close() (#4330)
21fa693d38a is described below

commit 21fa693d38a0ea684899ac12729e1785f95e622f
Author: Ashutosh Gupta <as...@st.niituniversity.in>
AuthorDate: Mon May 30 17:34:06 2022 +0100

    HADOOP-18238. Fix reentrancy check in SFTPFileSystem.close() (#4330)
    
    
    Contributed by Ashutosh Gupta
---
 .../src/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 46b829f14a1..3260a0db514 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();


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org