HADOOP-18238. Fix reentrancy check in SFTPFileSystem.close() (#4330)
Contributed by Ashutosh Gupta
This commit is contained in:
parent
ba6520f67f
commit
21fa693d38
@ -709,11 +709,11 @@ public FileStatus getFileStatus(Path f) throws IOException {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
if (closed.getAndSet(true)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
super.close();
|
super.close();
|
||||||
|
if (closed.getAndSet(true)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (connectionPool != null) {
|
if (connectionPool != null) {
|
||||||
connectionPool.shutdown();
|
connectionPool.shutdown();
|
||||||
|
Loading…
Reference in New Issue
Block a user