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

goroutine leak #1936

Closed
zhixinwen opened this issue Mar 21, 2018 · 4 comments
Closed

goroutine leak #1936

zhixinwen opened this issue Mar 21, 2018 · 4 comments

Comments

@zhixinwen
Copy link

Please answer these questions before submitting your issue.

What version of gRPC are you using?

13975c0

What version of Go are you using (go version)?

go 1.9.2

What operating system (Linux, Windows, …) and version?

Linux version 4.4.52 (jenkins@debbuilder02-sjc1) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 SMP Sun Feb 26 18:02:02 UTC 2017

What did you do?

We update the our grpc version to 13975c070286c7371aa3a8b3c230e90d7bf029fc, no other code change.
p.s we use the experimental WithBalancer(b Balancer) DialOption in dial

What did you expect to see?

nothing should happen

What did you see instead?

goroutine leaks. Number of goroutine increases with time and does not stop.
We checked the goroutine dump, and see the following goroutine should be the source of leaking.

.../vendor/google.golang.org/grpc.newClientStream.func4(0xc420308f00, 0xc424812380, 0x2218ac0, 0xc4223a3ce0)
.../vendor/google.golang.org/grpc/stream.go:298 +0x112
created by code.uber.internal/everything/order/vendor/google.golang.org/grpc.newClientStream
.../vendor/google.golang.org/grpc/stream.go:297 +0xb59

We can confirm that we only created one stream ourselves, it is not clear how are other streams created

@dfawley dfawley changed the title goroutine leak in version 13975c070286c7371aa3a8b3c230e90d7bf029fc goroutine leak Mar 21, 2018
@lyuxuan
Copy link
Contributor

lyuxuan commented Mar 21, 2018

After #1854, we no longer clean up orphan streams. Could you please check whether you explicitly end the stream you created by using the 4 ways described in the #1854? If you didn't end the streams you created accordingly, then the goroutine monitoring the context for each stream will sit there forever, and it might have caused the problem you saw.

If you do end every stream you created accordingly, then there might be a bug on our side. If so, could you please give us a simple reproducible example so we can investigate more? Thank you!

@menghanl
Copy link
Contributor

@zhixinwen Do you still see this problem?

@zhixinwen
Copy link
Author

zhixinwen commented Jun 13, 2018 via email

@menghanl
Copy link
Contributor

Closing this issue for now. Please reply back or file a new issue if you encounter problems later.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants