You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Matthias J. Sax (Jira)" <ji...@apache.org> on 2025/09/10 04:29:00 UTC

[jira] [Resolved] (KAFKA-19679) NoSuchElementException (again) in Kafka Streams iterator metrics

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

Matthias J. Sax resolved KAFKA-19679.
-------------------------------------
    Fix Version/s: 4.2.0
                   4.1.1
       Resolution: Fixed

> NoSuchElementException (again) in Kafka Streams iterator metrics
> ----------------------------------------------------------------
>
>                 Key: KAFKA-19679
>                 URL: https://issues.apache.org/jira/browse/KAFKA-19679
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 4.0.1, 4.1.0
>            Reporter: Steven Schlansker
>            Assignee: Nikita Shupletsov
>            Priority: Minor
>             Fix For: 4.2.0, 4.1.1
>
>
> Since upgrading to Kafka 4.1.0, we again see in our metrics collection:
> {code:java}
> Exception thrown from GraphiteReporter#report. Exception was suppressed.
> java.util.NoSuchElementException: null
> 	at java.base/java.util.concurrent.ConcurrentSkipListMap.firstKey(ConcurrentSkipListMap.java:1863)
> 	at java.base/java.util.concurrent.ConcurrentSkipListSet.first(ConcurrentSkipListSet.java:393)
> 	at org.apache.kafka.streams.internals.metrics.OpenIterators.lambda$add$0(OpenIterators.java:57)
> 	at org.apache.kafka.common.metrics.KafkaMetric.metricValue(KafkaMetric.java:81) {code}
> I think unfortunately the dynamic registration introduced in KAFKA-19398 ([https://github.com/apache/kafka/pull/20022]) might have reverted the fix from [https://github.com/apache/kafka/pull/18771]
> There is still a race between removing the metric gauge, and the last iterator being removed from the tracking set.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)