Expose/create KeeperException for "Packet len <x> is out of range!" error when 
jute max buffer size is exceeded
---------------------------------------------------------------------------------------------------------------

                 Key: ZOOKEEPER-1313
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1313
             Project: ZooKeeper
          Issue Type: Bug
            Reporter: Daniel Lord


When a zookeeper client receives a Packet that is over the jute max buffer 
limit the behavior that is exposed to the callers of the zookeeper client is 
misleading.  When the packet length exceeds the max size an IOException is 
thrown.  This is caught and handled by the SendThread by cleaning up the 
current connection and enqueueing a Disconnected event.  The immediate caller 
of zookeeper sees this as a ConnectionLossException with a Disconnected event 
on the main Watcher.  This state transition is a bit misleading because under 
many circumstances as soon as the SyncConnected event is received retrying the 
same operation will succeed.  However, in this case it is likely that the 
zookeeper client will reconnect immediately and if the operation is retried the 
same jute max buffer limit exception will be thrown which will trigger another 
disconnect and reconnect.

It would be great if the exception was exposed to the caller of the zookeeper 
client some how so that a more appropriate action can be taken.  For instance, 
it might be appropriate to fail completely or to attempt to establish a new 
session.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to