[
https://issues.apache.org/jira/browse/ZOOKEEPER-4360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Damien Diederen resolved ZOOKEEPER-4360.
----------------------------------------
Fix Version/s: 3.8.0
Resolution: Fixed
Issue resolved by pull request 1743
[https://github.com/apache/zookeeper/pull/1743]
> Avoid NPE during metrics execution if the leader is not set on a FOLLOWER
> node
> -------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-4360
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4360
> Project: ZooKeeper
> Issue Type: Bug
> Components: metric system
> Affects Versions: 3.6.2
> Reporter: Nicoló Boschi
> Priority: Major
> Labels: metrics, pull-request-available
> Fix For: 3.8.0, 3.7.1, 3.6.4
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> On a follower node, we had this error
> {code}
> ago 20, 2021 1:46:28 PM org.apache.catalina.core.StandardWrapperValve invoke
> GRAVE: Servlet.service() for servlet [metrics] in context with path
> [/metrics] threw exception
> java.lang.NullPointerException: Cannot invoke
> "org.apache.zookeeper.server.quorum.Leader.getProposalStats()" because the
> return value of
> "org.apache.zookeeper.server.quorum.LeaderZooKeeperServer.getLeader()" is null
> at
> org.apache.zookeeper.server.quorum.LeaderZooKeeperServer.lambda$registerMetrics$5(LeaderZooKeeperServer.java:122)
> at
> magnews.zookeeper.ZooKeeperMetricsProviderAdapter$MetricsContextImpl.lambda$registerGauge$0(ZooKeeperMetricsProviderAdapter.java:91)
> {code}
> Unfortunately, I'm not able to reproduce this error deterministically
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)