You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2021/08/30 09:02:08 UTC

[GitHub] [zookeeper] nicoloboschi opened a new pull request #1743: Avoid NPE during gauge execution if the leader is set on FOLLOWER node

nicoloboschi opened a new pull request #1743:
URL: https://github.com/apache/zookeeper/pull/1743


   On a follower node, we had this error
   ```
   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)
   ```
   
   
   Unfortunately, I'm not able to reproduce this error deterministically
   
   I've added the null check on leader variable, this will cause the gauge return value to be not registered (on `DefaultMetricsProvider`) and considered as zero on prometheus
   
   Not sure if tests were needed even if the fix is so simple, I can them if requested from reviewers 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zookeeper] ztzg closed pull request #1743: ZOOKEEPER-4360 Avoid NPE during gauge execution if the leader is not set on FOLLOWER node

Posted by GitBox <gi...@apache.org>.
ztzg closed pull request #1743:
URL: https://github.com/apache/zookeeper/pull/1743


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zookeeper] ztzg commented on pull request #1743: ZOOKEEPER-4360 Avoid NPE during gauge execution if the leader is not set on FOLLOWER node

Posted by GitBox <gi...@apache.org>.
ztzg commented on pull request #1743:
URL: https://github.com/apache/zookeeper/pull/1743#issuecomment-911877403


   This is now in `master`, `branch-3.7` and `branch-3.6`.  Thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zookeeper] nicoloboschi commented on pull request #1743: ZOOKEEPER-4360 Avoid NPE during gauge execution if the leader is not set on FOLLOWER node

Posted by GitBox <gi...@apache.org>.
nicoloboschi commented on pull request #1743:
URL: https://github.com/apache/zookeeper/pull/1743#issuecomment-908204957


   thanks @eolivelli , https://issues.apache.org/jira/browse/ZOOKEEPER-4360 created, set 3.7.1 and 3.6.4 as fix versions as you suggested


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org