-
Notifications
You must be signed in to change notification settings - Fork 333
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
refactor retry to close watchFactory #3226
Conversation
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.
/lgtm |
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.
/lgtm
@bpickard22 can you please rebase?
01622a4
to
e1a3919
Compare
/lgtm |
@ricky-rav PTAL |
/test Build-PR |
/test build-pr |
/retest |
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.
/lgtm
Let's squash all commits into one?
876dae2
to
6a6bf96
Compare
Now we've introduced a new data race between
So
|
leverage stop channel on watch factory when periodic retry stopchannel is called Problem: Hybrid test was creating creating an ovn-controller for some tests. The tests could not use the waitGroup in the test so the afterEach function (cleanup function after each test) could execute while leaving controllers up. In the tests, we were leveraging the code in ovn.go to run the controllers and creating a watcher pod on them. This issue was just a symptom of the main issue which was that we were using the incorrect stopChannel in the retry logic. Solution: The stopChannel that we use in the watchFactory is private, so we created a function that when called will close the watcher stopChannel, closing the watcher. We then call this function in the select (basically a switch statement in go but for channels) to close the watcher, because when we stop watching an object, that means we no longer care about it and should stop retrying it. This also adds a public waitgroup property to the watchfactory that we are using to ensure that the retry loop has exited before we shutdown the watcher to avoid any races there Since we no longer use the stopChannel in the retryFramework, this also removes that stopChannel from the newRetryFramework function definition, and all its refrences (which at this time was just in obj_retry_master) Signed-off-by: Ben Pickard <bpickard@redhat.com> Closes: ovn-org#3203 Remove stopChannel from retryFrameowork We no longer use the controller stopChannel passed to the retryFramework, as we use the watcher stopChannel, so we can remove it Signed-off-by: Ben Pickard <bpickard@redhat.com>
/lgtm |
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.
/lgtm
NIT: the comment in the commit has creating mentioned twice. But that is no biggie.
"Problem: Hybrid test was creating creating an ovn-controller for some tests."
leverage stop channel on watch factory when periodic retry stopchannel is called
Problem: Hybrid test was creating creating an ovn-controller for some tests.
The tests could not use the waitGroup in the test so the afterEach function
(cleanup function after each test) could execute while leaving controllers up.
In the tests, we were leveraging the code in ovn.go to run the controllers
and creating a watcher pod on them. This issue was just a symptom of the main
issue which was that we were using the incorrect stopChannel in the retry logic.
Solution: The stopChannel that we use in the watchFactory is private, so we
created a function that when called will close the watcher stopChannel,
closing the watcher. We then call this function in the select
(basically a switch statement in go but for channels) to close the watcher,
because when we stop watching an object, that means we no longer care about it
and should stop retrying it.
Signed-off-by: Ben Pickard bpickard@redhat.com
Closes: #3203