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


##########
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:
   @nizhikov , thanks for the response. Here's my understanding:
   Before this PR, when it failed in 
   L473: `lifecycleManager.setReadyToUnfence().get()`, we'll get 
   ```
   Fatal error during broker startup. Prepare to shutdown.
   java.lang.RuntimeException: Received a fatal error while waiting for the 
broker to be unfenced.
    at ....
    at ....
   
   ...
   Exiting Kafka due to fatal exception during startup.
   java.lang.RuntimeException: Received a fatal error while waiting for the 
broker to be unfenced.
    at ....
    at ....
   ```
   
   But after your PR, it will not show the message: `Received a fatal error 
while waiting for the broker to be unfenced` in both top/bottom logs if it's 
`ExecutionException`, which is unexpected.
   
   My expectation is after this PR, we can display the cause of the 
`RuntimeException` in the below log output, ex: 
   ```
   ```
   Exiting Kafka due to fatal exception during startup.
   java.lang.IOException: Not enough disk space
    at ....
    at ....
   ```
   If that will make the logic too complicated, maybe we'll just leave it as 
is. Thoughts?
   



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