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


##########
core/src/main/scala/kafka/server/KafkaServer.scala:
##########
@@ -830,7 +830,13 @@ class KafkaServer(
   private def checkpointBrokerMetadata(brokerMetadata: ZkMetaProperties) = {
     for (logDir <- config.logDirs if logManager.isLogDirOnline(new 
File(logDir).getAbsolutePath)) {
       val checkpoint = brokerMetadataCheckpoints(logDir)
-      checkpoint.write(brokerMetadata.toProperties)
+      try {
+        checkpoint.write(brokerMetadata.toProperties)
+      } catch {
+      case e: IOException =>
+        val dirPath = checkpoint.file.getAbsolutePath
+        logDirFailureChannel.maybeAddOfflineLogDir(dirPath, s"Error while 
writing meta.properties to $dirPath", e)

Review Comment:
   handle IOException during writing meta.properties, to avoid it gracefully 
shutdown the broker.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to