HDFS-5806. Balancer should set soTimeout to avoid indefinite hangs. Contributed by Nathan Roberts.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1560548 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Wang 2014-01-22 22:33:00 +00:00
parent 163348701c
commit 1c602f7198
2 changed files with 4 additions and 0 deletions

View File

@ -585,6 +585,9 @@ Release 2.4.0 - UNRELEASED
HDFS-5748. Too much information shown in the dfs health page. HDFS-5748. Too much information shown in the dfs health page.
(Haohui Mai via brandonli) (Haohui Mai via brandonli)
HDFS-5806. balancer should set SoTimeout to avoid indefinite hangs.
(Nathan Roberts via Andrew Wang).
BREAKDOWN OF HDFS-2832 SUBTASKS AND RELATED JIRAS BREAKDOWN OF HDFS-2832 SUBTASKS AND RELATED JIRAS
HDFS-4985. Add storage type to the protocol and expose it in block report HDFS-4985. Add storage type to the protocol and expose it in block report

View File

@ -337,6 +337,7 @@ public class Balancer {
sock.connect( sock.connect(
NetUtils.createSocketAddr(target.datanode.getXferAddr()), NetUtils.createSocketAddr(target.datanode.getXferAddr()),
HdfsServerConstants.READ_TIMEOUT); HdfsServerConstants.READ_TIMEOUT);
sock.setSoTimeout(HdfsServerConstants.READ_TIMEOUT);
sock.setKeepAlive(true); sock.setKeepAlive(true);
OutputStream unbufOut = sock.getOutputStream(); OutputStream unbufOut = sock.getOutputStream();