-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clientv3: how watch know the remote etcd is closed? #5985
Comments
You should kill the listener, then the stream will be shutdown. Or you can enable progressNotify to do application level heartbeat. |
Watch isn't really meant for detecting disconnects. Maybe use a Session? |
I call embed etcd Close, and I think it will close the listener too, but watch doesn't know it. |
@siddontang After enabling with progress notify, the watcher should expect to receive notification at least every minute. If it cannot receive anything, you should kill it. Watch is designed to handle connection failures, so it just keep on retrying. @heyitsanthony Shall we expose the errors by adding a errc chan? |
@siddontang Also as @heyitsanthony mentioned, watch is not really designed for detecting connection issues. |
@xiang90 I don't think Watch should say anything about disconnects; it's at the wrong network layer. The feature probably belongs in the balancer. |
@heyitsanthony I do not mean watcher API. I mean for the client interface, we probably should expose some errorc. So the user can know the client is experiencing connection errors. |
@xiang90 sure, agreed |
Answers are provided. So I am closing this. |
Hi @xiang90 |
@siddontang is there a reason why |
@heyitsanthony we need to watch a key changed, |
Hi
I start on etcd node and use the simple watch example here https://godoc.org/github.com/coreos/etcd/clientv3#example-Watcher--Watch
but when I kill etcd server, I find that we can't know the server is down and watch still hangs up.
Do we have any way to check server is down in watch?
The text was updated successfully, but these errors were encountered: