Github user afine commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/412#discussion_r147815941 --- Diff: src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java --- @@ -905,10 +907,22 @@ protected void pRequest(Request request) throws RequestProcessorException { request.setTxn(new ErrorTxn(Code.MARSHALLINGERROR.intValue())); } } + checkProposalSize(request); request.zxid = zks.getZxid(); nextProcessor.processRequest(request); } + private void checkProposalSize(Request request) { + if (request.getHdr() == null) return; + byte[] data = SerializeUtils.serializeRequest(request); + if (data.length > BinaryInputArchive.maxBuffer) { --- End diff -- why do we need this if we are also checking how much data has been written when writing to the binary output archive?
---