Oh, I forgot a point. I can't seem to find a definition of CONNECTION_LOSS in the source code. Where does that come from?
regards, Jan 2011/2/2 Ride Shoot Speak <[email protected]> > Hi Thijs, > > thanks for the information. A state diagram would help me a lot. Can > someone in charge put it online again or just send it to the list please? > > So ZOO_CONNECTING_STATE is when I issue requests to the ZooKeeper server > between zookeeper_init and ZOO_CONNECTED_STATE. Did I get it right? My > understanding of the ZOO_CONNECTING_STATE state so far was: The client > ZooKeeper library tries to reconnect to the ZooKeeper und tries to > reestablish a pending session. This then results in ZOO_CONNECTED_STATE > or ZOO_EXPIRED_SESSION_STATE. So I guess I was wrong. > > regards, > Jan > > 2011/2/2 Thijs Terlouw <[email protected]> > > On Wed, Feb 2, 2011 at 7:24 PM, Ride Shoot Speak >> <[email protected]> wrote: >> > Hi ZooKeepers, >> > >> > I'd like to get some information about the the states >> ZOO_CONNECTING_STATE >> > and ZOO_ASSOCIATING_STATE and how to handle them appropriately. I can't >> seem >> > to find any information about those states. Right now I simply drop the >> > connection if my callback is called with these states. >> > >> > TIA >> > Jan >> >> Hi Jan, >> >> I would normally refer you to the state diagram of the ZooKeeper >> states, but it seems not to be working ( >> http://wiki.apache.org/hadoop/ZooKeeper/FAQ#A1 ) >> >> ZOO_CONNECTING_STATE : This is when you try to send a request to the >> ZooKeeper server, when the client library is still actively connecting >> to a server (Session establishment is asynchronous). Requests will be >> queued. If the connection attempt fails, any requests fail with >> CONNECTION_LOSS >> >> ZOO_ASSOCIATING_STATE : I believe the handshake between the client and >> the server is still in progress, also part of the connection process. >> >> I only handle ZOO_EXPIRED_SESSION_STATE (need to explicitly make a new >> zookeeper connection) and ZOO_CONNECTED_STATE (client library is ready >> to be used) explicitly in my client code (I don't use authentication >> so can ignore ZOO_AUTH_FAILED_STATE) >> >> -- >> Thijs Terlouw, >> Shenzhen, China >> http://www.startinchina.com >> > >
