You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/11/08 22:44:57 UTC

[GitHub] [kafka] jsancio commented on a diff in pull request #12833: KAFKA-14370: Properly close ImageWriter objects

jsancio commented on code in PR #12833:
URL: https://github.com/apache/kafka/pull/12833#discussion_r1017191691


##########
core/src/main/scala/kafka/server/metadata/BrokerMetadataListener.scala:
##########
@@ -398,8 +398,11 @@ class BrokerMetadataListener(
         build()
       try {
         _image.write(writer, options)
-      } finally {
-        writer.close()
+        writer.close(true)

Review Comment:
   `MetadataImage::write` calls `ImageWriter::close(true)`. Can we remove that call? It if very difficult to read and understand code that closes `AutoCloseable` in different layers of the code.



-- 
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-unsubscribe@kafka.apache.org

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