Nico Kruber created FLINK-18276:
-----------------------------------
Summary: NullPointerException when closing KafkaConsumer
Key: FLINK-18276
URL:
https://issues.apache.org/jira/browse/FLINK-18276 Project: Flink
Issue Type: Bug
Components: Connectors / Kafka
Affects Versions: 1.10.1, 1.9.3, 1.8.3, 1.11.0
Reporter: Nico Kruber
{code}
WARN org.apache.flink.streaming.connectors.kafka.internal.KafkaFetcher - Error while closing Kafka consumer
java.lang.NullPointerException
at org.apache.flink.streaming.connectors.kafka.internal.KafkaConsumerThread.run(KafkaConsumerThread.java:282)
{code}
{{KafkaConsumerThread#reassignPartitions}} is temporarily setting {{consumer}} to {{null}} and if there is an exception (in this case, it was a timeout), the {{finally}} block in {{KafkaConsumerThread.run}} would fail with an NPE. Even more so, {{KafkaConsumerThread#reassignPartitions}} put the original consumer into {{consumerTmp}} which is not closed now and may leak underlying (Kafka) resources.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)