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:
us...@infra.apache.org


Reply via email to