Browse Source

HADOOP-1255. Fix a bug where the namenode falls into an infinite loop trying to remove a dead node. Contributed by Hairong.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@536296 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 years ago
parent
commit
23320bc848
2 changed files with 9 additions and 4 deletions
  1. 3 0
      CHANGES.txt
  2. 6 4
      src/java/org/apache/hadoop/dfs/FSNamesystem.java

+ 3 - 0
CHANGES.txt

@@ -362,6 +362,9 @@ Trunk (unreleased changes)
 
 107. HADOOP-1310.  Fix unchecked warnings in aggregate code.  (tomwhite)
 
+108. HADOOP-1255.  Fix a bug where the namenode falls into an infinite
+     loop trying to remove a dead node.  (Hairong Kuang via cutting)
+
 
 Release 0.12.3 - 2007-04-06
 

+ 6 - 4
src/java/org/apache/hadoop/dfs/FSNamesystem.java

@@ -1494,10 +1494,12 @@ class FSNamesystem implements FSConstants {
         
       // also treat the registration message as a heartbeat
       synchronized(heartbeats) {
-        heartbeats.add(nodeS);
-        //update its timestamp
-        nodeS.updateHeartbeat(0L, 0L, 0);
-        nodeS.isAlive = true;
+        if( !heartbeats.contains(nodeS)) {
+          heartbeats.add(nodeS);
+          //update its timestamp
+          nodeS.updateHeartbeat(0L, 0L, 0);
+          nodeS.isAlive = true;
+        }
       }
       return;
     }