-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Open
Labels
Description
Bug report criteria
- This bug report is not security related, security issues should be disclosed privately via security@etcd.io.
- This is not a support request or question, support requests or questions should be raised in the etcd discussion forums.
- You have read the etcd bug reporting guidelines.
- Existing open issues along with etcd frequently asked questions have been checked and this is not a duplicate.
What happened?
ServerWatchStream can't be closed when client closed watcher
What did you expect to happen?
when client closed watcher ServerWatchStream should be closed
How can we reproduce it (as minimally and precisely as possible)?
using jetcd write the follow code and run
while(1) {
Watch.Watcher watcher = etcdClient.getWatchClient().watch(....);
TimeUnit.SECONDS.sleep(5);
watcher.close();
}
Anything else we need to know?
func (ws *watchServer) Watch(stream pb.Watch_WatchServer) (err error) {
in this function, sws.recvLoop() return nil when recv EOF,so the line errc <- rerr will never be executed.
go the below select will never be executed. this lead to serverWatchStream leak.
Etcd version (please run commands below)
$ etcd --version
# 3.5.17
$ etcdctl version
# 3.5.17
Etcd configuration (command line flags or environment variables)
paste your configuration here
Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)
$ etcdctl member list -w table
# paste output here
$ etcdctl --endpoints=<member list> endpoint status -w table
# paste output here
Relevant log output
exceptionplayer