You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Jason Gustafson (Jira)" <ji...@apache.org> on 2020/06/08 23:48:00 UTC

[jira] [Resolved] (KAFKA-10063) UnsupportedOperation when querying cleaner metrics after shutdown

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

Jason Gustafson resolved KAFKA-10063.
-------------------------------------
    Fix Version/s: 2.6.0
       Resolution: Fixed

> UnsupportedOperation when querying cleaner metrics after shutdown
> -----------------------------------------------------------------
>
>                 Key: KAFKA-10063
>                 URL: https://issues.apache.org/jira/browse/KAFKA-10063
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Jason Gustafson
>            Assignee: Chia-Ping Tsai
>            Priority: Major
>             Fix For: 2.6.0
>
>
> We have a few log cleaner metrics which iterate the set of cleaners. For example:
> {code}
>   newGauge("max-clean-time-secs", () => cleaners.iterator.map(_.lastStats.elapsedSecs).max.toInt)
> {code}
> It seems possible currently for LogCleaner metrics to get queried after shutdown of the log cleaner, which clears the `cleaners` collection. This can lead to the following error:
> {code}
> java.lang.UnsupportedOperationException: empty.max
> 	at scala.collection.IterableOnceOps.max(IterableOnce.scala:952)
> 	at scala.collection.IterableOnceOps.max$(IterableOnce.scala:950)
> 	at scala.collection.AbstractIterator.max(Iterator.scala:1279)
> 	at kafka.log.LogCleaner.kafka$log$LogCleaner$$$anonfun$new$9(LogCleaner.scala:132)
> 	at kafka.log.LogCleaner$$anonfun$4.value(LogCleaner.scala:132)
> 	at kafka.log.LogCleaner$$anonfun$4.value(LogCleaner.scala:132)
> {code}



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