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

Contributed by Ashutosh Gupta

Change-Id: I2742675add74259a93b3762a80c7ab5ee6d08c37
This commit is contained in:
Ashutosh Gupta 2022-05-30 17:34:06 +01:00 committed by Steve Loughran
parent dd9b8af9c4
commit de4c975710
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
1 changed files with 3 additions and 3 deletions

View File

@ -709,11 +709,11 @@ public class SFTPFileSystem extends FileSystem {
@Override @Override
public void close() throws IOException { public void close() throws IOException {
try {
super.close();
if (closed.getAndSet(true)) { if (closed.getAndSet(true)) {
return; return;
} }
try {
super.close();
} finally { } finally {
if (connectionPool != null) { if (connectionPool != null) {
connectionPool.shutdown(); connectionPool.shutdown();