Skip to content
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

watch grpc stream stays open after the last watcher is canceled #62

Closed
yehiyam opened this issue Feb 13, 2018 · 5 comments
Closed

watch grpc stream stays open after the last watcher is canceled #62

yehiyam opened this issue Feb 13, 2018 · 5 comments

Comments

@yehiyam
Copy link
Contributor

yehiyam commented Feb 13, 2018

Following my conclusion from #61 I saw that when the last watch is canceled, the gRPC stream on the client side is closed, and a new one is created when a new watch is requested.
Looking at the etcd prometheus metric etcd_debugging_mvcc_watch_stream_total, the watch stream in the server is not closed, and the count is increasing until the client process exit.
This leads to resource leak in the server.

@yehiyam
Copy link
Contributor Author

yehiyam commented Mar 5, 2018

@connor4312 Anything progress on this?

@godu
Copy link
Contributor

godu commented Mar 29, 2018

etcd-io/etcd#9391

@godu
Copy link
Contributor

godu commented Mar 29, 2018

I try to replace all this.getStream().end(); by this.getStream().cancel();.
https://github.com/mixer/etcd3/blob/master/src/watch.ts
It's not a graceful close, but i think we need to provide an extra method to force to cancel connection.

@monkbroc
Copy link
Contributor

monkbroc commented Apr 30, 2018

I'm going to use @godu fork until this issue is resolved in upstream.
https://www.npmjs.com/package/@coorpacademy/etcd3
CoorpAcademy@1905266

@connor4312
Copy link
Member

Thanks for raising the issue. Unfortunately it's hard to write a test for this, but I made the changes which'll land in v0.2.10 soon.

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

No branches or pull requests

4 participants