HDFS-16068. WebHdfsFileSystem has a possible connection leak in connection with HttpFS (#3104)

This commit is contained in:
Takanobu Asanuma 2021-06-15 16:50:09 +09:00 committed by GitHub
parent c1bf3cb0da
commit 839fcf7682
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -2502,10 +2502,12 @@ InputStream initializeInputStream(HttpURLConnection conn)
@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;
}