Browse Source

HDFS-9911. TestDataNodeLifeline Fails intermittently. Contributed by Yiqun Lin

(cherry picked from commit a95639068c99ebcaefe8b6c4268449d12a6577d6)
Anu Engineer 8 years ago
parent
commit
d20dc8691e

+ 2 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java

@@ -1083,7 +1083,7 @@ class BPServiceActor implements Runnable {
     volatile long nextHeartbeatTime = monotonicNow();
 
     @VisibleForTesting
-    volatile long nextLifelineTime = monotonicNow();
+    volatile long nextLifelineTime;
 
     @VisibleForTesting
     volatile long lastBlockReportTime = monotonicNow();
@@ -1111,6 +1111,7 @@ class BPServiceActor implements Runnable {
       this.lifelineIntervalMs = lifelineIntervalMs;
       this.blockReportIntervalMs = blockReportIntervalMs;
       this.slowPeersReportIntervalMs = slowPeersReportIntervalMs;
+      scheduleNextLifeline(nextHeartbeatTime);
     }
 
     // This is useful to make sure NN gets Heartbeat before Blockreport