showuon commented on code in PR #15732: URL: https://github.com/apache/kafka/pull/15732#discussion_r1568277518
########## metadata/src/main/java/org/apache/kafka/metadata/migration/KRaftMigrationDriver.java: ########## @@ -391,13 +391,20 @@ void enqueueMetadataChangeEvent( // Events handled by Migration Driver. abstract class MigrationEvent implements EventQueue.Event { + // Use no-op handler by default because the handleException will be overridden if needed + private Consumer<Throwable> retryHandler = NO_OP_HANDLER; + + public void retryHandler(Consumer<Throwable> retryHandler) { + this.retryHandler = retryHandler; + } Review Comment: > Did you consider simply defining an empty public void retryHandler(Throwable thrown) that PollEvent can override? Nice suggestion! Updated! > Also, should we call wakeup (run next poll ASAP) rather that scheduleDeferred if the exception is retryable? Thanks for the suggestion. I think that's not appropriate because if the retriable error needs some time to be fixed (ex: the ZK connection issue), the pollEvent will be invoked a lot of times (and keep retrying) in a short period of time. -- 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