Nicoló Boschi created ZOOKEEPER-4360:
----------------------------------------

             Summary: 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
             Fix For: 3.7.1


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)

Reply via email to