chia7712 commented on a change in pull request #10761:
URL: https://github.com/apache/kafka/pull/10761#discussion_r639477851



##########
File path: core/src/main/scala/kafka/log/Log.scala
##########
@@ -325,19 +325,25 @@ class Log(@volatile private var _dir: File,
     // Ensure we do not try to assign a provided topicId that is inconsistent 
with the ID on file.
     if (partitionMetadataFile.exists()) {
         if (!keepPartitionMetadataFile)
-          partitionMetadataFile.delete()
+          try partitionMetadataFile.delete()
+          catch {
+            case e: IOException =>
+              error(s"Error while trying to delete partition metadata file 
${partitionMetadataFile}", e)

Review comment:
       Should `partitionMetadataFile` override `toString` to offer readable 
message?




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to