paultanay commented on issue #4203:
URL: https://github.com/apache/hertzbeat/issues/4203#issuecomment-5381065294

   I traced the bug to two places.
   
   monitorCollectTaskTimeout() pre-removes the map entry before calling 
dispatchCollectData(). If the real collect finishes in that window, it also 
calls dispatchCollectData() and both paths continue unchecked, producing a 
duplicate cyclicJob() and sendMetricsData().
   
   The Prometheus dispatch path in MetricsCollect.run() also has no 
fastFailed() guard, unlike the standard path.
   
   Fix: dispatchCollectData() owns the atomic map remove and acts as the 
once-wins gate. A late duplicate call sees metricsTime == null and returns 
early. cancel() fires after dispatch so cyclicJob() inside it still works. let 
me draft a PR.


-- 
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