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

frequently receive a StateDisconnected #31

Closed
Terry-Mao opened this issue May 28, 2014 · 2 comments
Closed

frequently receive a StateDisconnected #31

Terry-Mao opened this issue May 28, 2014 · 2 comments

Comments

@Terry-Mao
Copy link

log:

comet103.yw-0-0.root.log.INFO.20140528-035809.33139:I0528 06:03:21.827998 33139 zk.go:50] zookeeper get a event: StateSyncConnected
comet103.yw-0-0.root.log.INFO.20140528-035809.33139:I0528 06:03:22.047343 33139 zk.go:50] zookeeper get a event: StateDisconnected
comet103.yw-0-0.root.log.INFO.20140528-035809.33139:I0528 06:03:22.295198 33139 zk.go:50] zookeeper get a event: StateConnecting
comet103.yw-0-0.root.log.INFO.20140528-035809.33139:I0528 06:03:22.295206 33139 zk.go:50] zookeeper get a event: StateConnected
comet103.yw-0-0.root.log.INFO.20140528-035809.33139:I0528 06:03:22.369996 33139 zk.go:50] zookeeper get a event: StateExpired
comet103.yw-0-0.root.log.INFO.20140528-035809.33139:I0528 06:03:22.370007 33139 zk.go:50] zookeeper get a event: StateDisconnected
comet103.yw-0-0.root.log.INFO.20140528-035809.33139:I0528 06:03:22.386103 33139 zk.go:50] zookeeper get a event: StateConnecting
comet103.yw-0-0.root.log.INFO.20140528-035809.33139:I0528 06:03:22.386112 33139 zk.go:50] zookeeper get a event: StateConnected
comet103.yw-0-0.root.log.INFO.20140528-035809.33139:I0528 06:03:22.742684 33139 zk.go:50] zookeeper get a event: StateHasSession
comet103.yw-0-0.root.log.INFO.20140528-035809.33139:I0528 06:03:22.818002 33139 zk.go:50] zookeeper get a event: StateDisconnected

seems go-zookeeper retry connecting, but session expired, then receive a StateHasSession, what does this mean?

@jimrobinson
Copy link

It looks to me as though this is set once the connection
has been established and it has finished its authentication
phase.

https://github.com/samuel/go-zookeeper/blob/master/zk/conn.go#L397

As to frequent connection/disconnection I wonder if that's
a problem outside of the zk library. Do you see the same
problem if you connect to it using some other client, such
as the zkCli client that comes with zookeeper?

I haven't seen that kind of flapping with my own tests
of go-zookeeper.

@Terry-Mao
Copy link
Author

the zookeeper host machine swap, so get a StateDisconnected, go-zookeeper library is ok.
when StateDisconnected then receive session expired we can retry connect to zk.

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