You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Xintong Song (Jira)" <ji...@apache.org> on 2021/01/20 15:00:03 UTC

[jira] [Updated] (FLINK-18276) NullPointerException (and potential leak) when closing KafkaConsumer after exception in reassignPartitions

     [ https://issues.apache.org/jira/browse/FLINK-18276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xintong Song updated FLINK-18276:
---------------------------------
    Fix Version/s:     (was: 1.10.3)
                   1.10.4

> NullPointerException (and potential leak) when closing KafkaConsumer after exception in reassignPartitions
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-18276
>                 URL: https://issues.apache.org/jira/browse/FLINK-18276
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / Kafka
>    Affects Versions: 1.8.3, 1.9.3, 1.10.1, 1.11.0
>            Reporter: Nico Kruber
>            Priority: Major
>             Fix For: 1.13.0, 1.11.4, 1.10.4
>
>
> {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)