showuon commented on code in PR #12574:
URL: https://github.com/apache/kafka/pull/12574#discussion_r962432424


##########
core/src/main/scala/kafka/server/BrokerServer.scala:
##########
@@ -448,6 +448,7 @@ class BrokerServer(
       try {
         metadataListener.startPublishing(metadataPublisher).get()
       } catch {
+        case ee: ExecutionException => throw ee
         case t: Throwable => throw new RuntimeException("Received a fatal 
error while " +
           "waiting for the broker to catch up with the current cluster 
metadata.", t)

Review Comment:
   I think the reason we'd like to wrap the original exception is to add some 
custom messages. I'm afraid after this change, it'll lose it and just throw 
ExecutionException directly.  
   
   I'm thinking, maybe in L485, we just do:
   ```
   throw if (e.isInstanceOf[RuntimeException]) e.getCause.getCause else e
   ```
   if we confirmed all the exceptions are wrapped with `RuntimeException`, Or 
maybe just `throw e` and don't care about `getCause`. WDYT?



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