Hi Stefan,

There's a timing issue when the client closes the connection. It sends a session close to the server and then starts to close it's own sockets. If the server closes the socket before the client does you can sometimes see the client get

java.net.SocketException: Socket is not connected

we are a bit paranoid about making sure you/we can debug unusual situations, so we include the trace in the WARN message in the log, just in case. In this situation though it is not an issue, in other situations (say the server drops it's connection) it would help to have the trace in a debugging situation, so we include it.

Btw, in general in the code if we are more concerned about an event we would output as an ERROR, not as a WARN.


Stefan Groschupf wrote:
I managed to upgrade my zookeeper 2 application to zookeeper 3.1.1/
All my tests run though my logs is full of following exception.

In my code I basically just invoice ZooKeeper.close();
Any idea what the problem could be?

09/03/27 02:07:51 INFO zookeeper.ZooKeeper:434 - Closing session: 0x120472f36480002 09/03/27 02:07:51 INFO zookeeper.ClientCnxn:999 - Closing ClientCnxn for session: 0x120472f36480002 09/03/27 02:07:51 INFO server.PrepRequestProcessor:360 - Processed session termination request for id: 0x120472f36480002 09/03/27 02:07:51 INFO server.NIOServerCnxn:752 - closing session:0x120472f36480002 NIOServerCnxn: java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1%0:2181 remote=/0:0:0:0:0:0:0:1%0:53636] 09/03/27 02:07:51 INFO zookeeper.ClientCnxn:892 - Exception while closing send thread for session 0x120472f36480002 : Read error rc = -1 java.nio.DirectByteBuffer[pos=0 lim=4 cap=4] 09/03/27 02:07:51 WARN zookeeper.ClientCnxn:932 - Ignoring exception during shutdown input
java.net.SocketException: Socket is not connected
    at sun.nio.ch.SocketChannelImpl.shutdown(Native Method)
at sun.nio.ch.SocketChannelImpl.shutdownInput(SocketChannelImpl.java:640)
    at sun.nio.ch.SocketAdaptor.shutdownInput(SocketAdaptor.java:360)
at org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:930)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:915)
09/03/27 02:07:51 INFO zookeeper.ClientCnxn:985 - Disconnecting ClientCnxn for session: 0x120472f36480002 09/03/27 02:07:51 INFO zookeeper.ZooKeeper:442 - Session: 0x120472f36480002 closed

Reply via email to