From a95639068c99ebcaefe8b6c4268449d12a6577d6 Mon Sep 17 00:00:00 2001 From: Anu Engineer Date: Fri, 16 Dec 2016 09:46:21 -0800 Subject: [PATCH] HDFS-9911. TestDataNodeLifeline Fails intermittently. Contributed by Yiqun Lin --- .../org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java index 25ab3b7eadf..52947992bbb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java @@ -1068,7 +1068,7 @@ class BPServiceActor implements Runnable { volatile long nextHeartbeatTime = monotonicNow(); @VisibleForTesting - volatile long nextLifelineTime = monotonicNow(); + volatile long nextLifelineTime; @VisibleForTesting volatile long lastBlockReportTime = monotonicNow(); @@ -1091,6 +1091,7 @@ class BPServiceActor implements Runnable { this.heartbeatIntervalMs = heartbeatIntervalMs; this.lifelineIntervalMs = lifelineIntervalMs; this.blockReportIntervalMs = blockReportIntervalMs; + scheduleNextLifeline(nextHeartbeatTime); } // This is useful to make sure NN gets Heartbeat before Blockreport