-
Notifications
You must be signed in to change notification settings - Fork 40k
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
[bug fix] TestCascadingDeletion during pull-kubernetes-unit-test flaky #55653
Conversation
/ok-to-test |
@@ -340,6 +341,7 @@ func (gb *GraphBuilder) Run(stopCh <-chan struct{}) { | |||
if monitor.stopCh != nil { | |||
stopped++ | |||
close(monitor.stopCh) | |||
monitor.stopCh = nil |
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 think either this or setting gb.monitors
to empty at the end of this function will fix the race?
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.
This modification also have data race, because monitor.stopCh is also used by
func (m *monitor) Run() {
m.controller.Run(m.stopCh)
}
I think your suggestion may be better.
/lgtm |
b194a65
to
61e0ecb
Compare
@caesarxuchao Would you tag again please? |
@@ -342,6 +342,9 @@ func (gb *GraphBuilder) Run(stopCh <-chan struct{}) { | |||
close(monitor.stopCh) | |||
} | |||
} | |||
|
|||
// Set monitors to nil to prevent data race with syncMonitors. |
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 think the comment is inaccurate. There's no race (as both Run
and syncMonitors
acquire monitorLock
). It's just that syncMonitors
will try doing the same monitor teardown work, not expecting anything but itself to close the monitor channels. Your fix is still fine, I just ask that the comment be updated to be less scary. How about "reset monitors so that the graph builder can be safely re-run/synced"?
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.
OK, thank you.
lgtm after addressing @ironcladlou's comment. Thank you! |
61e0ecb
to
fbf81bc
Compare
@caesarxuchao Done. |
/test pull-kubernetes-node-e2e |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: caesarxuchao, hzxuzhonghu Associated issue: 55652 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Failed test is #55917 |
/retest Review the full test history for this PR. |
2 similar comments
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
Automatic merge from submit-queue (batch tested with PRs 55908, 55829, 55293, 55653, 55665). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
fix pull-kubernetes-unit-test flaky.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #55652
Special notes for your reviewer:
Release note: