Re: How to reestablish a session

2010-11-19 Thread Gustavo Niemeyer
> is_unrecoverable() means exactly that: the session is toast. nothing you do > will get it back. Ok, I was wondering about what exactly was unrecoverable indeed. > zookeeper_init is almost never used with a non-null client_id. the main use > case for it is crash recovery. i've rarely seen it use

Re: How to reestablish a session

2010-11-18 Thread Benjamin Reed
is_unrecoverable() means exactly that: the session is toast. nothing you do will get it back. zookeeper_init is almost never used with a non-null client_id. the main use case for it is crash recovery. i've rarely seen it used, but you can start a session, save off the client_id to disk, create

Re: How to reestablish a session

2010-11-18 Thread Gustavo Niemeyer
> why don't you let the client library do the move for you? Maybe there's no need to reestablish the session manually, but there are a few details in the API which give a hint this should be supported. The strongest one is that there's a parameter in zookeeper_init() to allow reestablishing an ex

Re: How to reestablish a session

2010-11-18 Thread Benjamin Reed
oops, sorry camille, i didn't mean to replicate your answer. you explained it better than me :) ben On 11/18/2010 10:06 AM, Fournier, Camille F. [Tech] wrote: This is exactly the scenario that you use to test session expiration, make one connection to a ZK and then another with the same sessi

Re: How to reestablish a session

2010-11-18 Thread Benjamin Reed
ah i see. you are manually reestablishing the connection to B using the session identifier for the session with A. the problem is that when you call "close" on a session, it kills the session. we don't really have a way to close a handle without do that. (actually there is a test class that do

Re: How to reestablish a session

2010-11-18 Thread Gustavo Niemeyer
> Right now, if you have a partition between client and server A, I would not > expect > server A to see a clean close from the client, but one of the various > exceptions > that cause the socket to close. Please don't get me wrong, but I find it very funny to rely on the stability of a network

Re: How to reestablish a session

2010-11-18 Thread Gustavo Niemeyer
Hi Ben, > that quote is a bit out of context. it was with respect to a proposed > change. My point was just that the reasoning why you believed it wasn't a good approach to kill ephemerals in that old instance applies to the new cases I'm pointing out. I wasn't suggesting you agreed with my new

Re: How to reestablish a session

2010-11-18 Thread Benjamin Reed
that quote is a bit out of context. it was with respect to a proposed change. in your scenario can you explain step 4)? what are you closing? ben On 11/18/2010 07:16 AM, Gustavo Niemeyer wrote: Greetings, As some of you already know, we've been using ZooKeeper at Canonical for a project we'v

RE: How to reestablish a session

2010-11-18 Thread Fournier, Camille F. [Tech]
This is exactly the scenario that you use to test session expiration, make one connection to a ZK and then another with the same session and password, and close the second connection, which causes the first to expire. It is only a clean close that will cause this to happen, though (one where the