-
Notifications
You must be signed in to change notification settings - Fork 42
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 parse.Run to use an event funnel #1272
Refactor parse.Run to use an event funnel #1272
Conversation
92bbc57
to
f6887f9
Compare
c00a18c
to
cad7935
Compare
/retest |
cad7935
to
5fed287
Compare
/retest |
1 similar comment
/retest |
5fed287
to
b142636
Compare
dfe215c
to
6461a8f
Compare
222ec76
to
f5f428e
Compare
SyncPeriod: opts.PollingPeriod, | ||
FullSyncPeriod: opts.ResyncPeriod, | ||
StatusUpdatePeriod: opts.StatusUpdatePeriod, | ||
// TODO: Shouldn't this use opts.RetryPeriod as the initial duration? |
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 seems like an existing bug. The Backoff wasn't being built with the RetryPeriod option.
bd2d7bd
to
1f9da0a
Compare
/cc @Camila-B |
@karlkfi: GitHub didn't allow me to request PR reviews from the following users: Camila-B. Note that only GoogleContainerTools members and repo collaborators can review this PR, and authors cannot review their own PRs. 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. |
8bbb464
to
f7b9406
Compare
852cc5a
to
2716f78
Compare
997373e
to
55cb26e
Compare
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.
One nit comment. Otherwise LGTM
Replace the timers in parse.Run with an set of event Producers that send events into a Funnel which synchronizes them for an EventHandler which executes the RunFunc as needed for specific event types. The PublishingGroupBuilder takes the timer periods and generates Publishers, one for each type of event. Then the event Funnel starts all the Publishers and runs a select loop that calls the Publisher's Publish method when that event is received. The Publish method then calls the Subscriber.Handle method. Motivation: - Allows for testing retry backoff in the event funnel, separate from the parser logic, using a FakeClock. - This should make parse.Run look a little more like a controller's Reconcile loop from controller-runtime, which paves the way for further refactoring. - This is not an ideal solution yet, just a next step towards something that's easier to test and easier to change.
55cb26e
to
66eaba4
Compare
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nan-yu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
9780d88
into
GoogleContainerTools:main
Replace the timers in parse.Run with an set of event Producers that
send events into a Funnel which synchronizes them for an EventHandler
which executes the RunFunc as needed for specific event types.
The PublishingGroupBuilder takes the timer periods and generates
Publishers, one for each type of event. Then the event Funnel starts
all the Publishers and runs a select loop that calls the Publisher's
Publish method when that event is received. The Publish method then
calls the Subscriber.Handle method.
Motivation:
attempts.
Dependencies:
Possible future cleanup: