kfaraz commented on code in PR #18014:
URL: https://github.com/apache/druid/pull/18014#discussion_r2094943246


##########
server/src/main/java/org/apache/druid/segment/realtime/SegmentGenerationMetrics.java:
##########
@@ -297,7 +313,12 @@ public SegmentGenerationMetrics snapshot()
       messageGapSnapshot = System.currentTimeMillis() - maxTimestamp;
     }
     retVal.messageGap.set(messageGapSnapshot);
-    retVal.messageGapStats.set(messageGapStats.getAndSet(new 
MessageGapStats()));

Review Comment:
   @jtuglu-netflix , sorry for the back and forth 😅 , but looking at this line 
in the current code, it seems that the `snapshot()` method will always create a 
new copy of `MessageGapStats`.
   
   So, will we ever have the case (in the current semantics of 
`TaskRealtimeMetricsMonitor`) where a reader thread and writer thread try to 
access the same instance of `MessageGapStats`?



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