[ https://issues.apache.org/jira/browse/FLINK-6366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15996036#comment-15996036 ]
ASF GitHub Bot commented on FLINK-6366: --------------------------------------- Github user fanyon closed the pull request at: https://github.com/apache/flink/pull/3759 > KafkaConsumer is not closed in FlinkKafkaConsumer09 > --------------------------------------------------- > > Key: FLINK-6366 > URL: https://issues.apache.org/jira/browse/FLINK-6366 > Project: Flink > Issue Type: Bug > Reporter: Fang Yong > Assignee: Fang Yong > > In getKafkaPartitions of FlinkKafkaConsumer09, the KafkaConsumer is created > as flowers and will not be closed. > {code:title=FlinkKafkaConsumer09.java|borderStyle=solid} > protected List<KafkaTopicPartition> getKafkaPartitions(List<String> topics) { > // read the partitions that belong to the listed topics > final List<KafkaTopicPartition> partitions = new ArrayList<>(); > try (KafkaConsumer<byte[], byte[]> consumer = new > KafkaConsumer<>(this.properties)) { > for (final String topic: topics) { > // get partitions for each topic > List<PartitionInfo> partitionsForTopic = > consumer.partitionsFor(topic); > ... > } > } > ... > } > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)