zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Austin Shoemaker <aus...@cooliris.com>
Subject Expired session id when reconnecting
Date Tue, 30 Sep 2008 08:01:29 GMT
The documentation in zookeeper.h states:

  *   clientid the id of a previously established session that this
  *   client will be reconnecting to. Pass 0 if not reconnecting to a  
  *   session. If the session timed out or the id is invalid, a new
  *   session will be automatically generated. Clients should check  
the actual
  *   session id by calling \ref zoo_client_id.

The implementation of zookeeper_init appears to enter  
EXPIRED_SESSION_STATE instead of automatically generating a new  
session id.

Would it be safe to remove this block in zookeeper.c check_events():

if (oldid != 0 && oldid != newid) {
     zh->state = EXPIRED_SESSION_STATE;
     errno = ESTALE;
     return handle_socket_error_msg(zh,__LINE__,ZSESSIONEXPIRED,
             "session %llx has expired.",oldid);
} else {

so that the new session continues to CONNECTED_STATE? It would be  
useful to receive a session expired notification without aborting the  



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message