HDFS-16068. WebHdfsFileSystem has a possible connection leak in connection with HttpFS (#3104)
(cherry picked from commit 839fcf7682
)
This commit is contained in:
parent
840612b3b1
commit
546c66b812
@ -2474,10 +2474,12 @@ InputStream initializeInputStream(HttpURLConnection conn)
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
void closeInputStream(RunnerState rs) throws IOException {
|
void closeInputStream(RunnerState rs) throws IOException {
|
||||||
if (in != null) {
|
if (in != null) {
|
||||||
IOUtils.close(cachedConnection);
|
|
||||||
in = null;
|
in = null;
|
||||||
}
|
}
|
||||||
cachedConnection = null;
|
if (cachedConnection != null) {
|
||||||
|
IOUtils.close(cachedConnection);
|
||||||
|
cachedConnection = null;
|
||||||
|
}
|
||||||
runnerState = rs;
|
runnerState = rs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user