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 in DeltaStreamHandler: fix for issue 913: #916

Merged
merged 3 commits into from
Apr 9, 2024

Conversation

zhiyanfoo
Copy link
Contributor

This PR adds a unit test for the go routine leak identified in issue 913. The bug fix is simply to re-use the same logic that already exists for the state-of-the-world StreamHandler.

You can re-create the goroutine leak by running the commit with just the test, and seeing that it fails before the fix.

@zhiyanfoo zhiyanfoo changed the title fix for issue 913: Goroutine leak in DeltaStreamHandler Goroutine leak in DeltaStreamHandler: fix for issue 913: Apr 8, 2024
Signed-off-by: Zhiyan Foo <zhiyanfoo@gmail.com>
Signed-off-by: Zhiyan Foo <zhiyanfoo@gmail.com>
@zhiyanfoo zhiyanfoo marked this pull request as ready for review April 8, 2024 21:34
Copy link
Contributor

@valerian-roche valerian-roche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. The implementation looks good to me, but a small detail on the test implementation.

err := s.DeltaAggregatedResources(resp)
require.Error(t, err)
resp.cancel()
defer goleak.VerifyNone(t)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be at the top, to be deferred last? It could be expected for some cleanup to be needed before through other defers in order to report no goroutine here

Signed-off-by: Zhiyan Foo <zhiyanfoo@gmail.com>
Copy link
Contributor

@valerian-roche valerian-roche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for tests now, thanks for this fix

@valerian-roche valerian-roche merged commit 149ddb1 into envoyproxy:main Apr 9, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants