You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Bruno Cadonna (Jira)" <ji...@apache.org> on 2020/03/13 16:58:00 UTC

[jira] [Commented] (KAFKA-9717) KafkaStreams#metrics() method randomly throws NullPointerException

    [ https://issues.apache.org/jira/browse/KAFKA-9717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17058929#comment-17058929 ] 

Bruno Cadonna commented on KAFKA-9717:
--------------------------------------

[~Bataitis] Thank you for the bug report! 
Judging from the code you use exactly-once semantics (EOS). Is this correct?
My guess is that it is a data race. With EOS, the call to {{KafkaStreams#metrics()}} accesses the set of tasks on a stream thread which can be modified by the stream thread itself during a rebalance.

> KafkaStreams#metrics() method randomly throws NullPointerException
> ------------------------------------------------------------------
>
>                 Key: KAFKA-9717
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9717
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 2.2.0
>         Environment: Kubernetes
>            Reporter: Zygimantas
>            Priority: Major
>
> We have implemented monitoring tool which monitors Kafka Streams application and regularly (every 20s) calls KafkaStreams.metrics() method in that application. But metrics() method randomly throws NullPointerException. It happens almost every time after application startup, but may also happen at random points in time after running application for few hours.
> Stacktrace:
> {code:java}
> java.lang.NullPointerException
>  at org.apache.kafka.streams.processor.internals.StreamThread.producerMetrics(StreamThread.java:1320)
>  at org.apache.kafka.streams.KafkaStreams.metrics(KafkaStreams.java:379)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)