Revert "HDFS-11280. Allow WebHDFS to reuse HTTP connections to NN. Contributed by Zheng Shao."

This reverts commit b811a1c14d.
This commit is contained in:
Brahma Reddy Battula 2017-01-03 19:19:29 +05:30
parent 6938b67711
commit b31e1951e0

View File

@ -659,9 +659,7 @@ protected HttpURLConnection connect(URL url) throws IOException {
url = new URL(conn.getHeaderField("Location")); url = new URL(conn.getHeaderField("Location"));
redirectHost = url.getHost() + ":" + url.getPort(); redirectHost = url.getHost() + ":" + url.getPort();
} finally { } finally {
// Don't call conn.disconnect() to allow connection reuse conn.disconnect();
// See http://tinyurl.com/java7-http-keepalive
conn.getInputStream().close();
} }
} }
try { try {
@ -893,9 +891,7 @@ final T getResponse(HttpURLConnection conn) throws IOException {
LOG.debug("Response decoding failure.", e); LOG.debug("Response decoding failure.", e);
throw ioe; throw ioe;
} finally { } finally {
// Don't call conn.disconnect() to allow connection reuse conn.disconnect();
// See http://tinyurl.com/java7-http-keepalive
conn.getInputStream().close();
} }
} }
@ -942,9 +938,6 @@ public void close() throws IOException {
try { try {
validateResponse(op, conn, true); validateResponse(op, conn, true);
} finally { } 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(); conn.disconnect();
} }
} }