Revert "HDFS-11280. Allow WebHDFS to reuse HTTP connections to NN. Contributed by Zheng Shao."
This reverts commit 0ff9efcf37e7e86c6b7e187df8e676c1e93fe0e7. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7392a5a7 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7392a5a7 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7392a5a7 Branch: refs/heads/branch-2.8 Commit: 7392a5a72cbde9f0fcf5c5463506bb8bcdbf856e Parents: b8be8f0 Author: Brahma Reddy Battula <[email protected]> Authored: Tue Jan 3 19:30:45 2017 +0530 Committer: Brahma Reddy Battula <[email protected]> Committed: Tue Jan 3 19:30:45 2017 +0530 ---------------------------------------------------------------------- .../org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/7392a5a7/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java index 4e143cc..166e3c3 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java @@ -663,9 +663,7 @@ public class WebHdfsFileSystem extends FileSystem url = new URL(conn.getHeaderField("Location")); redirectHost = url.getHost() + ":" + url.getPort(); } finally { - // Don't call conn.disconnect() to allow connection reuse - // See http://tinyurl.com/java7-http-keepalive - conn.getInputStream().close(); + conn.disconnect(); } } try { @@ -897,9 +895,7 @@ public class WebHdfsFileSystem extends FileSystem LOG.debug("Response decoding failure.", e); throw ioe; } finally { - // Don't call conn.disconnect() to allow connection reuse - // See http://tinyurl.com/java7-http-keepalive - conn.getInputStream().close(); + conn.disconnect(); } } @@ -946,9 +942,6 @@ public class WebHdfsFileSystem extends FileSystem try { validateResponse(op, conn, true); } finally { - // This is a connection to DataNode. Let's disconnect since - // there is little chance that the connection will be reused - // any time soonl conn.disconnect(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
