-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 leaks #528
Comments
|
I think this is only a problem with the tests. e.g. this fixes CompressOK: @@ -1283,10 +1308,12 @@ func testCompressOK(t *testing.T, e env) {
t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, <nil>", err)
}
// Streaming RPC
- stream, err := tc.FullDuplexCall(context.Background())
+ ctx, cancel := context.WithCancel(context.Background())
+ stream, err := tc.FullDuplexCall(ctx)
if err != nil {
t.Fatalf("%v.FullDuplexCall(_) = _, %v, want <nil>", tc, err)
}
+ defer cancel()
respParam := []*testpb.ResponseParameters{
{
Size: proto.Int32(31415), |
|
Yes, it is the test problem. These two tests keep the streams open when they exit. I am going to fix them soon. Thanks for reporting. |
|
BTW, goroutine leaking checker would be very helpful. Previously, I used debug/pprof/block to check manually. Thanks. |
|
I have fixes for these locally too. I can include them in my CL if you want, or send separately. |
|
My PR is also ready. Running tests now to make sure it is okay. I think making it a separate PR would be better. Feel free to send your fix out if you want. Otherwise, I can send mine too. :) |
|
I'll send mine, since it has the leak checker in the same CL. I'll send it first, before my bigger changes. |
|
sgtm On Fri, Feb 5, 2016 at 1:24 PM, Brad Fitzpatrick notifications@github.com
|
|
I noticed more failures on the Travis run once I enabled this: @iamqizhao, this one doesn't look as obviously easy to fix. I'm going to disable the leak checker for now and get it submitted, and then you can fix this bug. |
Some leaks remain, so this is disabled for now. Updates grpc#528
Some leaks remain, so this is disabled for now. Updates grpc#528
Some leaks remain, so this is disabled for now. Updates grpc#528
|
I am looking. |
|
Should we re-open this bug? I didn't mean to close it in the commit message but somehow managed to. |
|
@bradfitz thanks a bunch for finding these! we spent a while trying to get down to where we were leaking goroutines in our prod servers. Rolling restarts got tiring after a while :) Will test these out ASAP :) |
|
@mwitkow, the ones I fixed I think only affect tests, not prod. I don't think you'll see a difference yet. @iamqizhao is still looking for the |
|
@mwitkow, but please comment here with details of which goroutines of yours you see leaking. |
|
#535 will fix this. Waiting for travis about 2 hrs already. It is overwhelmed by a lot of pull requests from grpc C++... |
stream.NewClientStream seems to leak a goroutine.
I have some unsent local changes to the end2end tests which check for goroutine leaks on each test.
I see:
That leak is from
stream.go:I started looking for this when running the race detector with a high
go test -race -count=NNNvalue, because the race detector hit its trackable goroutine limit and crashed, which made me suspicious what was leaking.I'll send changes for adding the goroutine leak checker.
The text was updated successfully, but these errors were encountered: