-
Notifications
You must be signed in to change notification settings - Fork 423
Prevent workspace deletion leaks #3491
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
Conversation
|
/hold Until after 0.28 released |
631efea to
61a0632
Compare
test/integration/framework/goleak.go
Outdated
| // KnownGoroutineLeaks are leaks from just running KCP collected | ||
| // with TestGoleakWithDefaults and run through: | ||
| // grep 'on top of the stack' output.log | cut -d, -f2- | cut -d' ' -f3 | sort | uniq |
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.
Most of the leaks were just KCP not shutting down properly because it was stopped too fast after reporting ready, as noted in #3488
The leftover are probably similar things as in the webhooks - goroutines or informer hooks that were started but never bound by a context.
88d1cc0 to
3cecee0
Compare
3cecee0 to
555f612
Compare
| // GoleakWithDefaults verifies that there are no goroutine leaks. | ||
| // Goleak tests cannot be run in parallelized tests. | ||
| func GoleakWithDefaults(tb testing.TB, in ...goleak.Option) { | ||
| tb.Helper() | ||
|
|
||
| tb.Logf("waiting %v for goroutines to finish", WaitTime) | ||
| time.Sleep(WaitTime) | ||
|
|
||
| opts := append(KnownGoroutineLeaks, in...) | ||
| goleak.VerifyNone(tb, opts...) | ||
| } |
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.
So the idea here was to use IgnoreCreatedBy to ignore any goroutines started by KCP when testing a component for leaks. However that requires the PR to be merged: uber-go/goleak#136
Since that doesn't seem to happen anytime soon I removed the entire helper function. The leak test for KCP itself is in framework/leak_test for now, the workspace leak test in workspace/leak_test.
1bdfbaa to
cbac814
Compare
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
In large traces some frames are elided to show the top and bottom of the stack trace. This wasn't handled in goleak until this PR: uber-go/goleak#120 But the maintainers haven't tagged a new version since this PR. Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
cbac814 to
c00bc30
Compare
|
/hold cancel |
39e5fe7 to
414435f
Compare
|
I'm not entirely sure why but the leak test always failed immediately with
|
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
414435f to
032f189
Compare
|
/retest |
|
/hold cancel |
embik
left a comment
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.
/approve
🚀
|
LGTM label has been added. DetailsGit tree hash: bd25b0627061a35360ef7ce2246a18acb7f15cef |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: embik The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |

Summary
Fix workspace deletion leaks as found in #3350
What Type of PR Is This?
/kind bug
Related Issue(s)
Fixes #3350
Release Notes