Skip to content
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

Fix scheduling of reconciliation #1567

Merged
merged 1 commit into from May 22, 2020

Conversation

sheerun
Copy link
Contributor

@sheerun sheerun commented May 11, 2020

This is improved version of #1543. It makes sure that:

  1. At most one reconciliation is executed at once (RunOnce is called in single place)
  2. Multiple reconciliation are batched (for now batching window is hardcored to 5s)
  3. We move the responsibility of scheduling, batching and throttling reconciliations from Source to Controller by moving it from ingress.go and service.go to controller.go and changing interface of AddEventHandler(handler func() error, stopChan <-chan struct{}, minInterval time.Duration) to AddEventHandler(ctx context.Context, handler func())
  4. We switch from stopChan to cancellable context
  5. bounded_frequency_runner.go is no longer necessary, all throttling logic is inside Controller
  6. We move TestSourceEventHandler to source_test.go (where it belongs), and add test for the behavior above

#1568 Should be merged first

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 11, 2020
@k8s-ci-robot k8s-ci-robot requested review from linki and Raffo May 11, 2020 12:51
@sheerun
Copy link
Contributor Author

sheerun commented May 11, 2020

/assign @Raffo

@sheerun sheerun force-pushed the fix-scheduling branch 5 times, most recently from b505853 to d82a093 Compare May 11, 2020 17:27
@sheerun
Copy link
Contributor Author

sheerun commented May 11, 2020

I think this is ready to be reviewed and merged

@sheerun sheerun force-pushed the fix-scheduling branch 4 times, most recently from 26bff8e to 533281f Compare May 12, 2020 22:11
.travis.yml Outdated Show resolved Hide resolved
internal/testutils/init.go Outdated Show resolved Hide resolved
source/source.go Outdated Show resolved Hide resolved
@sheerun
Copy link
Contributor Author

sheerun commented May 19, 2020

@tariq1890 Please refresh, I've rebased this on master

main.go Show resolved Hide resolved
@tariq1890
Copy link
Contributor

Changes LGTM. deferring to @njuettner or @Raffo

@sheerun
Copy link
Contributor Author

sheerun commented May 22, 2020

@tariq1890 @ytsarev For the future: you can use /lgtm to inform bot as well :)

@Raffo
Copy link
Contributor

Raffo commented May 22, 2020

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 22, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Raffo, sheerun

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2020
@k8s-ci-robot k8s-ci-robot merged commit 1afc720 into kubernetes-sigs:master May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants