edoardocomar commented on code in PR #18833:
URL: https://github.com/apache/kafka/pull/18833#discussion_r1949573689


##########
core/src/main/scala/kafka/server/BrokerServer.scala:
##########
@@ -803,7 +807,7 @@ class BrokerServer(
       if (clientToControllerChannelManager != null)
         CoreUtils.swallow(clientToControllerChannelManager.shutdown(), this)
 
-      if (logManager != null)
+      if (logManager != null && lifecycleManager != null)

Review Comment:
   Thanks @apoorvmittal10 
   
   the body of the if 
   ```
         if (logManager != null && lifecycleManager != null)
           CoreUtils.swallow(logManager.shutdown(lifecycleManager.brokerEpoch), 
this)
   ```
   so if `lifecycleManager` was null but `logManager` was not, there still 
would be an NPE.
   
   having said that, 
   the reason I encountered the NPE was because logManager creation failed, so 
logManager was null and the body of the if would have been skipped anyway. 



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