hanm commented on a change in pull request #1080: ZOOKEEPER-3496: Transaction 
larger than jute.maxbuffer makes ZooKeeper service unavailable
URL: https://github.com/apache/zookeeper/pull/1080#discussion_r323568403
 
 

 ##########
 File path: zookeeper-jute/src/main/java/org/apache/jute/BinaryInputArchive.java
 ##########
 @@ -85,6 +85,18 @@ public String readString(String tag) throws IOException {
     }
     
     static public final int maxBuffer = Integer.getInteger("jute.maxbuffer", 
0xfffff);
+    static public final int readExtraSize;
+
+    static {
+        Integer configuredValue =
+            Integer.getInteger("zookeeper.jute.maxbuffer.extrasize", 
maxBuffer);
+        if (configuredValue < 1024) {
+            // Earlier hard coded value is 1024, So the value should not be 
less than that
+            readExtraSize = 1024;
 
 Review comment:
   Do we have a reasonable estimate of an upper bound of the extra field 
padding which could reasonably cover more practice use cases, so users don't 
have to configure this value themselves? Obviously it's not tractable to find a 
single value that cover all cases (unless we use infinity), but it seems 
reasonable to increase this value - say by 10x while still be safeguarding 
requests with unreasonable length.
   
   

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


With regards,
Apache Git Services

Reply via email to