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


##########
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:
   that seems error-prone to me, since the issue is caused by an incorrect 
initialization order. Perhaps we should use anonymous class to ensure the 
initialization order. for example:
   ```java
           this.expirationReaper = new ShutdownableThread("ExpirationReaper-" + 
brokerId + "-" + purgatoryName, false) {
               @Override
               public void doWork() {
                   try {
                       advanceClock(200L);
                   } catch (InterruptedException ie) {
                       throw new RuntimeException(ie);
                   }
               }
           };
   ```



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