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 2021/02/18 19:50:08 UTC

[GitHub] [kafka] rhauch commented on a change in pull request #10153: KAFKA-12340: Fix potential resource leak in Kafka*BackingStore

rhauch commented on a change in pull request #10153:
URL: https://github.com/apache/kafka/pull/10153#discussion_r578702660



##########
File path: connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java
##########
@@ -291,7 +293,17 @@ public void start() {
     @Override
     public void stop() {
         log.info("Closing KafkaConfigBackingStore");
-        configLog.stop();
+        try {
+            configLog.stop();
+        } finally {
+            if (ownTopicAdmin != null) {
+                try {
+                    ownTopicAdmin.close();
+                } finally {
+                    ownTopicAdmin = null;
+                }

Review comment:
       Good suggestion. Replaced this try-finally block with a simple `close()` call here an in the other 2 places.




----------------------------------------------------------------
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:
users@infra.apache.org