-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Guarantee watch before action in e2e event observer helper function. #43107
Guarantee watch before action in e2e event observer helper function. #43107
Conversation
- This change should guarantee that in observeEventAfterAction, the action is only executed after the informer begins watching the event stream.
cf91666
to
05696cf
Compare
/assign |
/lgtm |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ConnorDoyle, bsalamat
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Thanks Connor for fixing this. |
Cc @timothysc |
@ConnorDoyle , I'm slightly confused... how could the action be executed prior to the event stream? |
@ConnorDoyle Trying to understand here, if this logic is really needed in both functions. So you are doing this, i think with the assumption, that when controller.Run is executed, watch might not have started, before in the immediate next step action is executed and it has a chance of missing the event/node update? May be like in nanosecond order. And then, later down the code, you are polling waiting for the event/node update upto 2 mins (order of mins), with the assumption, that the even/node update might not have appeared upto 2 mins? |
@timothysc and @aveshagarwal, here's an illustration of the before/after scenarios around this PR as I understand it: Before: no ordering gurarantee between concurrent test and informer goroutines.
After: added synchronization to provide ordering guarantee.
|
@ConnorDoyle I think I get that. I was wondering if it brings any real advantage in most (or all practical e2e) scenarios. May be like in a corner case that might not be experienced ever. That said I dont see any harm really in doing this and it LGTM. |
@ConnorDoyle gotcha... I have other comments about some of the logic but we can hold off and revisit, b/c I want to see @bsalamat 's flake patch get in. |
@aveshagarwal as @ConnorDoyle graph shows, there was a clear race condition between starting the watch and performing the action. Please note that the event that we are watching for happens as a result of |
@bsalamat Thats what I was trying to understand/explain in #43107 (comment), what is the probability of that happening, given that the polling code waits for upto 2m? |
@aveshagarwal the race occurs before the test goroutine begins polling. More generally, the point behind the PR that depends on this (#42928) is to rely on causality, not timing in the scheduling e2e tests. The point is to eliminate the need for speculation about probabilities of the various interleavings based on expected timings. |
Automatic merge from submit-queue |
@ConnorDoyle: The following test(s) failed:
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. |
What this PR does / why we need it:
Adds a missing synchronization barrier to an e2e event observation helper function.
the action is only executed after the informer begins watching
the event stream.
Release note:
cc @kubernetes/sig-scheduling-pr-reviews @bsalamat