james strachan commented on ZOOKEEPER-84:

I hear you :)

So an Elect Leader or Write Lock protocol has to deal with expired sessions and 
create new sessions; at some point someone has to recreate something. You can 
pass the buck and say we're not gonna allow the ZooKeeper to reconnect. Then 
say we're not allowed to have the WriteLock reconnect, then the next and next 
layer of the onion. But eventually there's gonna be something somewhere that 
recreates a session :)

For now I'll work on the assumption we're gonna have to have an object which is 
a wrapper around a ZooKeeper so that it can handle reconnections by just 
discarding one ZooKeeper instance and creating another. This object could be 
shared across Protocols (we might wanna reuse one connection with ZK to make 
multiple locks for example).

> provide a mechanism to reconnect a ZooKeeper if a client receives a 
> SessionExpiredException
> -------------------------------------------------------------------------------------------
>                 Key: ZOOKEEPER-84
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-84
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: java client
>            Reporter: james strachan
>            Assignee: james strachan
>         Attachments: reconnect_patch.patch
> am about to attach a patch which adds a reconnect() method to easily 
> re-establish a connection if a session expires - along with a toString() 
> implementation for easier debugging

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to