Steven Schlansker created KAFKA-19679:
-----------------------------------------

             Summary: NoSuchElementException (again) in Kafka Streams iterator 
metrics
                 Key: KAFKA-19679
                 URL: https://issues.apache.org/jira/browse/KAFKA-19679
             Project: Kafka
          Issue Type: Bug
    Affects Versions: 4.1.0
            Reporter: Steven Schlansker


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)

Reply via email to