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/04/12 10:10:54 UTC

[GitHub] [zookeeper] arshadmohammad commented on a change in pull request #1681: ZOOKEEPER-4247: NPE while processing message from restarted quorum member

arshadmohammad commented on a change in pull request #1681:
URL: https://github.com/apache/zookeeper/pull/1681#discussion_r611499234



##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/NettyServerCnxn.java
##########
@@ -520,8 +520,12 @@ private void receiveMessage(ByteBuf message) {
                         if (len < 0 || len > BinaryInputArchive.maxBuffer) {
                             throw new IOException("Len error " + len);
                         }
-                        // checkRequestSize will throw IOException if request is rejected
-                        zkServer.checkRequestSizeWhenReceivingMessage(len);
+                        if (zkServer == null || !zkServer.isRunning()) {
+                            throw new IOException("ZK down");
+                        } else {

Review comment:
       can we move `zkServer.checkRequestSizeWhenReceivingMessage(len);` out of else block  and remove the else block.
   otherwise logically there are more statements which should be in else block
   




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