kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: KAFKA-5345; Close KafkaClient when streams client is closed
Date Thu, 01 Jun 2017 20:54:45 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.11.0 e370714d9 -> 1db85b1a2


KAFKA-5345; Close KafkaClient when streams client is closed

Author: Rajini Sivaram <rajinisivaram@googlemail.com>

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #3195 from rajinisivaram/KAFKA-5345

(cherry picked from commit 6b9bc3fd26d0e565c1fe86ce46859f9c1a024987)
Signed-off-by: Ismael Juma <ismael@juma.me.uk>


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/1db85b1a
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/1db85b1a
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/1db85b1a

Branch: refs/heads/0.11.0
Commit: 1db85b1a2e4b218cd41c2398d0357f2b204ad1ae
Parents: e370714
Author: Rajini Sivaram <rajinisivaram@googlemail.com>
Authored: Thu Jun 1 21:54:28 2017 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Thu Jun 1 21:54:53 2017 +0100

----------------------------------------------------------------------
 .../streams/processor/internals/StreamsKafkaClient.java      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/1db85b1a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsKafkaClient.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsKafkaClient.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsKafkaClient.java
index b1c3f2b..2d47876 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsKafkaClient.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsKafkaClient.java
@@ -141,8 +141,12 @@ public class StreamsKafkaClient {
     }
 
     public void close() throws IOException {
-        for (MetricsReporter metricsReporter: this.reporters) {
-            metricsReporter.close();
+        try {
+            kafkaClient.close();
+        } finally {
+            for (MetricsReporter metricsReporter: this.reporters) {
+                metricsReporter.close();
+            }
         }
     }
 


Mime
View raw message