Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
2.6.1
-
None
-
Reviewed
Description
BPServiceActor#blockReport has the following check:
List<DatanodeCommand> blockReport() throws IOException { // send block report if timer has expired. final long startTime = monotonicNow(); if (startTime - lastBlockReport <= dnConf.blockReportInterval) { return null; }
Many tests trigger an immediate block report via BPServiceActor#triggerBlockReportForTests which sets lastBlockReport = 0. However if the machine was restarted recently then startTime may be less than dnConf.blockReportInterval and the block report is not sent.
Time#monotonicNow uses System#nanoTime which represents time elapsed since an arbitrary origin. The time should be used only for comparison with other values returned by System#nanoTime.