From 6a3963cc8b4cdadf6dc8d2a9ca4f3af4da50a1d2 Mon Sep 17 00:00:00 2001 From: Todd Lipcon Date: Wed, 15 Jun 2011 21:36:56 +0000 Subject: [PATCH] HDFS-2071. Use of isConnected() in DataXceiver is invalid. Contributed by Kihwal Lee. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1136205 13f79535-47bb-0310-9956-ffa450edef68 --- hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/server/datanode/DataXceiver.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hdfs/CHANGES.txt b/hdfs/CHANGES.txt index f3acf8f448..5cae67db23 100644 --- a/hdfs/CHANGES.txt +++ b/hdfs/CHANGES.txt @@ -1218,6 +1218,9 @@ Release 0.22.0 - Unreleased HDFS-988. saveNamespace race can corrupt the edits log. (eli) + HDFS-2071. Use of isConnected() in DataXceiver is invalid. (Kihwal Lee + via todd) + Release 0.21.1 - Unreleased HDFS-1466. TestFcHdfsSymlink relies on /tmp/test not existing. (eli) diff --git a/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java b/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java index 098f151d4a..76a00d565c 100644 --- a/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java +++ b/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java @@ -178,7 +178,7 @@ public void run() { opStartTime = now(); processOp(op, in); ++opsProcessed; - } while (s.isConnected() && socketKeepaliveTimeout > 0); + } while (!s.isClosed() && socketKeepaliveTimeout > 0); } catch (Throwable t) { LOG.error(datanode.getMachineName() + ":DataXceiver, at " + s.toString(), t);