andreiz / php-zookeeper

A PHP extension for interfacing with Apache ZooKeeper
Other
449 stars 215 forks source link

Closing Connection Properly? #26

Open moilanen opened 11 years ago

moilanen commented 11 years ago

I'm seeing an exception on the Zookeeper side about the client closing the connection:

[2013-08-30 14:54:44,560] INFO Accepted socket connection from /10.0.0.108:60358 (org.apache.zookeeper.server.NIOServerCnxn)
[2013-08-30 14:54:44,561] INFO Client attempting to establish new session at /10.0.0.108:60358 (org.apache.zookeeper.server.NIOServerCnxn)
[2013-08-30 14:54:44,568] INFO Established session 0x140cfa4ae54000c with negotiated timeout 10000 for client /10.0.0.108:60358 (org.apache.zookeeper.server.NIOServerCnxn)
[2013-08-30 14:54:44,705] INFO Processed session termination for sessionid: 0x140cfa4ae54000c (org.apache.zookeeper.server.PrepRequestProcessor)
[2013-08-30 14:54:44,705] WARN EndOfStreamException: Unable to read additional data from client sessionid 0x140cfa4ae54000c, likely client has closed socket (org.apache.zookeeper.server.NIOServerCnxn)
[2013-08-30 14:54:44,706] INFO Closed socket connection for client /10.0.0.108:60358 which had sessionid 0x140cfa4ae54000c (org.apache.zookeeper.server.NIOServerCnxn)
[2013-08-30 14:54:44,714] ERROR Unexpected Exception:  (org.apache.zookeeper.server.NIOServerCnxn)
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:367)
        at org.apache.zookeeper.server.SyncRequestProcessor.flush(SyncRequestProcessor.java:161)
        at org.apache.zookeeper.server.SyncRequestProcessor.run(SyncRequestProcessor.java:98)

Is there a more graceful way we can close explictly close the connection so not cause an exception on the Zookeeper side?

Thanks, Jake

ebuzzz commented 9 years ago

Just for the record: the zk-ruby module has the same problem. It seems to be a server side issue For more information, see https://github.com/zk-ruby/zookeeper/pull/54

It does not seem to have any negative effect (apart from creating large logfiles).

Timandes commented 9 years ago

This is a C Client issue. See: https://issues.apache.org/jira/browse/ZOOKEEPER-1105

Maybe it'll be fixed in version 3.5.2 or 3.6.0 ...

Please close the issue. Thx.