Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Client need some way to get the session expiration timeout #210

Open
magodo opened this issue Mar 18, 2019 · 1 comment
Open

Client need some way to get the session expiration timeout #210

magodo opened this issue Mar 18, 2019 · 1 comment

Comments

@magodo
Copy link

magodo commented Mar 18, 2019

As we know, the timeou passed to zk.Connect() is not necessarily to be the final one. Hence the client should have some way to tell the final timeout after authenticating between server.

This timeout value is necessary when zk is used to implement lock. In this case, when client holding the lock disconnect, it should behave conservatively to try to stop all the outstanding tasks before client expires. If client couldn't guarantee this, then it should just quit (so as to avoid brain split).

@msolo
Copy link

msolo commented Mar 18, 2019

The session timeout is internally reset on connect. Unfortunately, accessing this private variable results in data races. It is fixed in our fork:

https://github.com/z-division/go-zookeeper/blob/master/zk/conn.go#L407

That could be exposed publicly which would match the Java client, but it is not something we have found broadly useful.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants