-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
node pods e2e test: fix goroutine leak #91607
node pods e2e test: fix goroutine leak #91607
Conversation
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
Hi @gaurav1086. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gaurav1086 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @yujuhong |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @oomichi
/retest |
I don't get the point of this PR. Even if not specifying the size of buffer,
It is nice to submit the corresponding issue on github to share what you are trying to solve. |
@oomichi add the sync.WaitGroup{} to expose this issue like this: https://play.golang.com/p/7zEa7TDXECh |
Thanks for the explanation. I got the point. Again, could submit the corresponding issue on github to explain what issue you are facing actually? |
|
@gaurav1086 |
@oomichi Not that I'm aware of since leaks are usually hard to catch. |
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
New changes are detected. LGTM label has been removed. |
@gaurav1086: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
// Iterate over the events and stop them to avoid leak | ||
for i := 0; i < numEvents; i++ { | ||
w := <-ch | ||
w.Stop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should compile.
@@ -319,6 +321,11 @@ var _ = SIGDescribe("Pods Extended", func() { | |||
} | |||
case <-time.After(5 * time.Minute): | |||
framework.Failf("timed out waiting for watch events for %s", pod.Name) | |||
// Iterate over the events and stop them to avoid leak | |||
for i := 0; i < numEvents; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
numEvents isn't synchronized, this should be a data race.
I think you need to temporarily artificially break the test to ensure that it goes through this timeout case, to test your fix to this timeout case.
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@gaurav1086: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Gaurav Singh gaurav1086@gmail.com
What type of PR is this?
What this PR does / why we need it:
the channel ch need to be buffered to prevent the goroutine in from hanging indefinitely
when the select statement reads something other than the one the goroutine sends on. i.e. timeouts
xref: #5316
The fix is to evaluate over all the events in the ch in case of timeout.
Which issue(s) this PR fixes:
Fixes #
N/A
Special notes for your reviewer:
xref: #5316
https://play.golang.com/p/7zEa7TDXECh
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: