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 2020/11/03 14:56:13 UTC

[GitHub] [zookeeper] belugabehr commented on a change in pull request #1520: ZOOKEEPER-3988: Protect zkServer from NullPointerException

belugabehr commented on a change in pull request #1520:
URL: https://github.com/apache/zookeeper/pull/1520#discussion_r516728503



##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/ServerCnxn.java
##########
@@ -147,8 +149,9 @@ public void incrOutstandingAndCheckThrottle(RequestHeader h) {
         if (h.getXid() <= 0) {
             return;
         }
-        if (zkServer.shouldThrottle(outstandingCount.incrementAndGet())) {
-            disableRecv(false);
+        if (zkServer.isPresent()

Review comment:
       My intent was to remove the NPE.  It is valid that `zkServer` could be `null` and yet there is no check for it (please review the original JIRA).
   
   Is there something else that should be done here?  Comments make it clear that `zkServer` has a valid value of `null`.




----------------------------------------------------------------
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.

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