[
https://issues.apache.org/jira/browse/KAFKA-4286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ismael Juma resolved KAFKA-4286.
--------------------------------
Resolution: Fixed
Assignee: Xavier Léauté
This was fixed by
https://github.com/apache/kafka/commit/006630fd93d8efb823e5b5f7d61584138df984a6,
which avoids the NPE by checking for null instead of caching the value.
[~junrao], if you think that caching the value would be better, please reopen
and we can do a follow up.
> metric reporter may hit NullPointerException during shutdown
> ------------------------------------------------------------
>
> Key: KAFKA-4286
> URL: https://issues.apache.org/jira/browse/KAFKA-4286
> Project: Kafka
> Issue Type: Bug
> Components: core
> Affects Versions: 0.10.0.0
> Reporter: Jun Rao
> Assignee: Xavier Léauté
>
> When we shut down a broker, our metric reporter could throw the following
> exception.
> java.lang.NullPointerException
> at kafka.network.Processor$$anon$2.value(SocketServer.scala:392)
> at kafka.network.Processor$$anon$2.value(SocketServer.scala:390)
> This is because we report Yammer metric like the following and we de-register
> the underlying Kafka metric when shutting down the socket server.
> newGauge("IdlePercent",
> new Gauge[Double] {
> def value = {
> metrics.metrics().get(metrics.metricName("io-wait-ratio",
> "socket-server-metrics", metricTags)).value()
> }
> },
> metricTags.asScala
> )
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)