Skip to content

ZK causing EndOfStreamException and CancelledKeyExceptions? #67

Description

@hsanjuan

While using ZK in the following way:

ZK.new(...) do |zk|
zk.with_lock(...) do

end
end

my logs get filled with:

2013-05-06 15:41:21,341 - INFO [CommitProcessor:1:ZooKeeperServer@595] - Established session 0x13e6ea9db2c0034 with negotiated timeout 20001 for client /10.218.xxx.xxx:33402 2013-05-06 15:42:25,734 - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@349] - caught end of stream exception EndOfStreamException: Unable to read additional data from client sessionid 0x13e6ea9db2c0034, likely client has closed socket at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220) at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208) at java.lang.Thread.run(Thread.java:722) 2013-05-06 15:42:25,735 - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1001] - Closed socket connection for client /10.218.xxx.xxx:33402 which had sessionid 0x13e6ea9db2c0034 2013-05-06 15:42:26,145 - ERROR [CommitProcessor:1:NIOServerCnxn@180] - 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:153) at org.apache.zookeeper.server.NIOServerCnxn.sendResponse(NIOServerCnxn.java:1076) at org.apache.zookeeper.server.FinalRequestProcessor.processRequest(FinalRequestProcessor.java:404) at org.apache.zookeeper.server.quorum.CommitProcessor.run(CommitProcessor.java:74)

Code works as expected, but I wonder if this is a ZK problem (dropping the connection before reading all that is to be read) or maybe the way i am using it is not correct?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions