orangeCatDeveloper commented on issue #2405:
URL: https://github.com/apache/hertzbeat/issues/2405#issuecomment-5861051594

   Root cause, still present on master: after each run, the next delay is 
computed in milliseconds and then integer-divided into seconds, which truncates 
the remainder. With a 30s interval and a 300 ms collection, the next run is 
scheduled 29s later instead of 29.7s, so every cycle fires up to 1s early and 
the collection time drifts.
   
   
https://github.com/apache/hertzbeat/blob/8104d7057c72f9c18dea31d32e076750d2c34020/hertzbeat-collector/hertzbeat-collector-common/src/main/java/org/apache/hertzbeat/collector/timer/TimerDispatcher.java#L241-L243
   
   The wheel timer is scheduled in `TimeUnit.SECONDS`; scheduling in 
milliseconds (or rounding instead of truncating) would fix it.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to