You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Takanobu Asanuma (Jira)" <ji...@apache.org> on 2021/06/15 01:19:00 UTC
[jira] [Created] (HDFS-16068) WebHdfsFileSystem has a possible
connection leak in connection with HttpFS
Takanobu Asanuma created HDFS-16068:
---------------------------------------
Summary: WebHdfsFileSystem has a possible connection leak in connection with HttpFS
Key: HDFS-16068
URL: https://issues.apache.org/jira/browse/HDFS-16068
Project: Hadoop HDFS
Issue Type: Bug
Reporter: Takanobu Asanuma
Assignee: Takanobu Asanuma
When we use WebHdfsFileSystem for HttpFS, some connections remain for a while after the filesystems are closed until GC runs. After investigating it for a while, I found that there is a potential connection leak in WebHdfsFileSystem.
{code:java}
// Close both the InputStream and the connection.
@VisibleForTesting
void closeInputStream(RunnerState rs) throws IOException {
if (in != null) {
IOUtils.close(cachedConnection);
in = null;
}
cachedConnection = null;
runnerState = rs;
}
{code}
In the above code, if the variable of {{in}} is null and {{cachedConnection}} is not null, {{cachedConnection}} doesn't close and the connection remains. I think this is the cause of our problem.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org