The server protects against a client DOSing the cluster (typically by accident) by limiting the number of maxClientCnxns from a particular host. Either set the limit higher, turn it off, or change your client logic to reduce the number of clients on a host (granted not always possible if this is testing).
Patrick On Thu, Jun 28, 2012 at 2:19 AM, Nikolay Ponomarenko <[email protected]> wrote: > Hello > > We are testing ZooKeeper 3.4.3 as distributed lock engine. > Pascal wrapper under Windows client c library. > > When i start more than maxClientCnxns connections, client log is full > of errors: > > 2012-06-28 14:37:06,381:1608(0x8c0):ZOO_ERROR@handle_socket_error_msg@1723: > Socket [192.168.1.13:2181] zk retcode=-4, errno=32(Broken pipe): > failed while receiving a server response > ... > 2012-06-28 14:37:21,896:1608(0xf30):ZOO_ERROR@handle_socket_error_msg@1481: > Socket [192.168.1.13:2181] zk retcode=-4, errno=10035(Unknown error): > failed to send a handshake packet: Unknown error > 2012-06-28 14:37:21,896:1608(0x8c0):ZOO_ERROR@handle_socket_error_msg@1481: > Socket [192.168.1.13:2181] zk retcode=-4, errno=10035(Unknown error): > failed to send a handshake packet: Unknown error > > Server log: > > 2012-06-28 11:47:27,453 - WARN > [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@634] - > EndOfStreamException: Unable to read additional data from client > sessionid 0x39383129b54a0031, likely client has closed socket > 2012-06-28 11:47:27,453 - INFO > [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1435] - > Closed socket connection for client /192.168.3.1:59641 which had > sessionid 0x39383129b54a0031 > 2012-06-28 11:47:27,471 - ERROR > [CommitProcessor:313:NIOServerCnxn@445] - Unexpected Exception: > java.nio.channels.CancelledKeyException > at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:73) > at sun.nio.ch.SelectionKeyImpl.interestOps(SelectionKeyImpl.java:77) > at > org.apache.zookeeper.server.NIOServerCnxn.sendBuffer(NIOServerCnxn.java:418) > at > org.apache.zookeeper.server.NIOServerCnxn.sendResponse(NIOServerCnxn.java:1509) > at > org.apache.zookeeper.server.FinalRequestProcessor.processRequest(FinalRequestProcessor.java:359) > at > org.apache.zookeeper.server.quorum.CommitProcessor.run(CommitProcessor.java:73) > > > Is there any way properly handle such errors from client side? > > -- > Nikolay Ponomarenko
