소스 검색

HADOOP-4840. TestNodeCount sometimes fails with NullPointerException. Contributed by Hairong Kuang.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@727869 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang 16 년 전
부모
커밋
f59975a1a5
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 0
      CHANGES.txt
  2. 3 1
      src/test/org/apache/hadoop/hdfs/server/namenode/TestNodeCount.java

+ 3 - 0
CHANGES.txt

@@ -1578,6 +1578,9 @@ Release 0.18.3 - Unreleased
     HADOOP-4797. Improve how RPC server reads and writes large buffers. Avoids
     soft-leak of direct buffers and excess copies in NIO layer. (Raghu Angadi)
 
+    HADOOP-4840. TestNodeCount sometimes fails with NullPointerException.
+    (hairong)
+
 Release 0.18.2 - 2008-11-03
 
   BUG FIXES

+ 3 - 1
src/test/org/apache/hadoop/hdfs/server/namenode/TestNodeCount.java

@@ -61,7 +61,9 @@ public class TestNodeCount extends TestCase {
       // check if excessive replica is detected
       NumberReplicas num = null;
       do {
-       num = namesystem.countNodes(block);
+       synchronized (namesystem) {
+         num = namesystem.countNodes(block);
+       }
       } while (num.excessReplicas() == 0);
       
       // find out a non-excess node