HDFS-16068. WebHdfsFileSystem has a possible connection leak in connection with HttpFS (#3104)
(cherry picked from commit 839fcf7682
)
This commit is contained in:
parent
8e6b09c0c2
commit
b8fc956a4d
|
@ -2448,10 +2448,12 @@ public class WebHdfsFileSystem extends FileSystem
|
|||
@VisibleForTesting
|
||||
void closeInputStream(RunnerState rs) throws IOException {
|
||||
if (in != null) {
|
||||
IOUtils.close(cachedConnection);
|
||||
in = null;
|
||||
}
|
||||
cachedConnection = null;
|
||||
if (cachedConnection != null) {
|
||||
IOUtils.close(cachedConnection);
|
||||
cachedConnection = null;
|
||||
}
|
||||
runnerState = rs;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue