HADOOP-18238. Fix reentrancy check in SFTPFileSystem.close() (#4330)

Contributed by Ashutosh Gupta
This commit is contained in:
Ashutosh Gupta 2022-05-30 17:34:06 +01:00 committed by GitHub
parent ba6520f67f
commit 21fa693d38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

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