-
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
Update to go-grpc/[email protected] to resolve connection memory leak #13051
Conversation
Hey @dekimsey Thanks for going ahead and updating this, much appreciated! We'll take a look at this hopefully this week or next and get you some feedback on test cases. |
Thanks so much for taking this on @dekimsey! 🙌🏻 The upgrade looks good to me, and it's great to have a test demonstrating the fix. I agree about the reflection and wonder if it'd be possible to count the number of connections on the server-side? either by wrapping the underlying TCP listener or implementing |
Thanks @boxofrad! I spent a bit of time poking at this idea. I used the already existing The test details aside, given the nature of the bug (leak in upstream) I'm not sure how valuable it is to have a test like this for anything other than identifying and confirming the issue is addressed. We aren't testing "our" code but an upstream's and to me that doesn't seem like a good fit in the test suite. I included the test because the initial reporter laid it out to demonstrate the issue which was great! But I'm not so sure about keeping it long-term. |
I think you're right @dekimsey, let's go ahead and remove the test. Thanks so much for looking into it though! |
fc406f9
to
fd17158
Compare
I removed the test case (documented it in the PR), squashed the PR, and rebased the changes. Assuming PR checks all pass I think it's good to go. Unfortunately I wasn't able to figure out how to back port the changes to 1.11. I ran afoul of dependency cascade issues within go-discover and had to back out. I think it'll require a more familiar touch to properly port it. |
That's great, thanks again! 🙇🏻♂️ It looks like the lint step is failing for reasons unrelated to this PR — I'll do some digging and then merge. Unfortunately, I'm not sure it's feasible to backport this change to 1.11 because it'd also require upgrading a number of other dependencies (including go-discover as you mention) which has a wider blast radius than we're generally comfortable with for this kind of backport. |
Reported in hashicorp#12288 The initial test reported was ported and accurately reproduced the issue. However, since it is a test of an upstream library's internal behavior it won't be codified in our test suite. Refer to the ticket/PR for details on how to demonstrate the behavior.
fd17158
to
b636b31
Compare
Description
Updates go-grpc/grpc to v1.37.1 to address memory leak issue in earlier versions.
Testing & Reproduction steps
I am including the test case I used to validate the behavior, I have removed it from the PR as it is testing internal library behavior and likely will not survive long-term. The test uses reflection to do some digging for connection leaks. The test when ported to 1.11.x at least demonstrates the issue cleanly.
Test code
In
agent/grpc/private/client_test.go
:v1.11.5, arm64 grpc/[email protected]
v1.12.0, arm64 grpc/[email protected]
Links
Fixes the issue discussed in #12288
PR Checklist