Github user eolivelli commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/673#discussion_r227557275 --- Diff: zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java --- @@ -1107,6 +1102,19 @@ public void processPacket(ServerCnxn cnxn, ByteBuffer incomingBuffer) throws IOE BinaryInputArchive bia = BinaryInputArchive.getArchive(bais); RequestHeader h = new RequestHeader(); h.deserialize(bia, "header"); + + // Need to increase the outstanding request count first, otherwise + // there might be a race condition that it enabled recv after + // processing request and then disabled when check throttling. + // + // It changes the semantic a bit, since when check throttling it's --- End diff -- Something simpler, without comparing current code with the old one. Like: Beware that we are actually checking the global outstanding request before this request. How does it sound to you?
---