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 13:17:05 UTC

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

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



##########
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:
       yeah, it is cleaner without the else block, I agree. And functionally equivalent. Thanks! I pushed a new commit.




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