Github user afine commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/412#discussion_r147816281
--- 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) {
+ LOG.error("Len error {}, larger than max buffer: {} set by
jute.maxbuffer",
+ data.length, BinaryInputArchive.maxBuffer);
--- End diff --
maybe there is a more appropriate place for maxBuffer since it applies to
input and output archive
---