As I understand (from the code), if the 2/3 timeout triggers, the socket will be cleaned up, so yet, if the server does response in the last 1/3, the response will be lost. If the client gets through half the timeout without hearing from the server, it sends a ping, so the ping has 1/6 of the timeout to respond.
-Ivan On 3 November 2014 16:01, Daniel Peon Quiros <[email protected]> wrote: > Hi Ivan, all, > > If I didn't understand wrong, then if there is no answer from the server in > 2/3 of the session timeout, the client will search another server to connect > to it. But, does it mean that once the client is looking for a different > server, it will connect to it even though in the last 1/3 of the session > timeout the server eventually answers? > > As it is stated below, the client has 1/3 of the timeout to find another > server, but my concern is what would happen if the server answers in that > last 1/3 of the session timeout: does the client keep the connection to the > same server? Or on the contrary does the client connect to a different server > anyway? > > Kind regards, > > Dani. > > -----Original Message----- > From: Ivan Kelly [mailto:[email protected]] > Sent: jueves, 30 de octubre de 2014 13:43 > To: zookeeper user list > Subject: Re: Session timeout parameter question > > Yes, if the partition occurs 1/3 of the timeout past the last time the server > has heard from the client. If the partition happens just after the server has > heard from the client and only last 2/3 of the timeout, the session will > probably not be timed out. The server will not timeout a session until it > hasn't heard from the client for the whole session timeout period. > > -Ivan > > On 30 October 2014 13:05, Alen Čaljkušić <[email protected]> wrote: >> Hi ZooKeeper community >> >> I have a question about session timeout parameter. Quote from >> ZooKeeper book by Flavio Junqueira and Benjamin Reed: >> >> "One important parameter you should set when creating a session is the >> session timeout, which is the amount of time the ZooKeeper service >> allows a session before declaring it expired. If the service does not >> see message associated to a given session during time t, it declares session >> expired. >> On the client side, if it has heard nothing from the server at 1/3 of >> t, it sends a heartbeat message to the server. At 2/3 of t, the >> ZooKeeper client starts looking for a different server, and it has >> another 1/3 of t to find one." >> >> Does this imply that network failure between client and all servers >> lasting >> 2/3 of session timeout parameter may cause session expired?
