curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Imesha Sudasingha <>
Subject Unable to re-establish a session once the session is lost
Date Mon, 05 Dec 2016 13:28:13 GMT
Hi all,

I'm using CuratorFramework to connect to ZooKeeper and I also use
authorization with ACL, CREATOR_ALL_ACL.

In order to test the functionality I deliberately disconnect my client
machine from the network. Then I see the connection state being changed to
SUSPENDED. Then after some time I see connection state change to LOST. (I'm
using connection timeout of 15 seconds and session timeout of 60 seconds).

Then, I reconnect the client machine to the network. Then I see the
following logs in my zookeeper logs which shows that the client is trying
to re-establish the previous connection.

INFO MBeanRegistry [ConnnectionExpirer] Unregister MBean
 INFO NIOServerCnxn [ConnnectionExpirer] Closed socket connection for
client / which had sessionid 0x20001dbe1940001
 INFO ZooKeeperServer [SessionTracker] Expiring session 0x20001dbe1940001,
timeout of 60000ms exceeded
 INFO ZooKeeperServer [SessionTracker] Submitting global closeSession
request for session 0x20001dbe1940001
 INFO PrepRequestProcessor [ProcessThread(sid:2 cport:-1):] Processed
session termination for sessionid: 0x20001dbe1940001
 INFO NIOServerCnxnFactory [NIOServerCxnFactory.AcceptThread:] Accepted socket connection from /
 INFO ZooKeeperServer [NIOWorkerThread-1] Client attempting to renew
session 0x20001dbe1940001 at /
 INFO Learner [NIOWorkerThread-1] Revalidating client: 0x20001dbe1940001
 INFO ZooKeeperServer
[QuorumPeer[myid=0](plain=/0:0:0:0:0:0:0:0:30155)(secure=disabled)] Invalid
session 0x20001dbe1940001 for client /, probably expired
 INFO NIOServerCnxn [NIOWorkerThread-2] Closed socket connection for client
/ which had sessionid 0x20001dbe1940001

As expected, resuming the session fails. But, there after nothing happens
in the client's side. No connection state changes, no retry attempts. When
I shutdown my application where I delete some ZNodes, I only see errors
saying "Keeper Error Code = ConnectionLoss" after sometime (which is due to
my retry policy, RetryNTimes(200,1000)).

Can anyone explain why does my CuratorFramework instance recreate a session
and establish connection again?

Thanks in advance!

- Imesha Sudasingha

*Imesha Sudasingha*
Undergraduate of Department of Computer Science and  Engineering,
University of Moratuwa.

View raw message