chia7712 commented on code in PR #19918:
URL: https://github.com/apache/kafka/pull/19918#discussion_r2133958016


##########
server-common/src/main/java/org/apache/kafka/server/purgatory/DelayedOperationPurgatory.java:
##########
@@ -86,6 +86,7 @@ public DelayedOperationPurgatory(String purgatoryName,
         this.purgeInterval = purgeInterval;
         this.reaperEnabled = reaperEnabled;
         this.timerEnabled = timerEnabled;
+        this.expirationReaper = new ExpiredOperationReaper();

Review Comment:
   Apologies for unclear comment. My point was that the `expirationReaper` 
initialization must happen after `brokerId` and `purgatoryName` are 
initialized. The dependency is implicit, which means we might inadvertently 
re-introduce a bug during future refactoring. Using an anonymous class could 
eliminate the happen-before constraint as it can directly reference the input 
arguments. 
   
   Alternatively, we could add comments to explicitly remind developers that 
`expirationReaper` must be initialized after `brokerId` and `purgatoryName` 



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to