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

✨ add 10% jitter to ResyncPeriod #647

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

xrmzju
Copy link
Member

@xrmzju xrmzju commented Oct 17, 2019

all informers use the same resync period, this may cause multi controllers send list requests to apiserver simultaneously, add a jitter to resync period would be better.
fixes #648

this pr uses ResyncPeriod to add a jitter to the SyncPeriod option before finally pass to the NewInformer func

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 17, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @xrmzju. Thanks for your PR.

I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 17, 2019
@xrmzju
Copy link
Member Author

xrmzju commented Oct 17, 2019

/ok-to-test

@k8s-ci-robot
Copy link
Contributor

@xrmzju: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

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.

@xrmzju
Copy link
Member Author

xrmzju commented Oct 17, 2019

/assign @DirectXMan12

SyncPeriod *time.Duration
// value only if you know what you are doing. Defaults to 5 hours if unset.
// the resync period in reflectors will be random between MinResyncPeriod and 2*MinResyncPeriod
MinResyncPeriod *time.Duration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change.

@DirectXMan12
Copy link
Contributor

closing for now -- see my response on the associated issue

@DirectXMan12
Copy link
Contributor

I misunderstood the purpose earlier -- this is about adding jitter to the resync interval. We'll need to make that more clear (and not make this a breaking change)

@xrmzju
Copy link
Member Author

xrmzju commented Oct 20, 2019

I misunderstood the purpose earlier -- this is about adding jitter to the resync interval. We'll need to make that more clear (and not make this a breaking change)

does [not make this a breaking change] means we should keep the Resync option and add a new MinResync option? or we just reuse the Resync option

@DirectXMan12
Copy link
Contributor

Reusing the resync option and using it as input for the jitter seems reasonable to me, but if you have other thoughts let me know. More review inline

Copy link
Contributor

@DirectXMan12 DirectXMan12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, please include a full description of the change. Simply linking to the issue is insufficient.

pkg/cache/cache.go Outdated Show resolved Hide resolved
pkg/cache/internal/deleg_map.go Outdated Show resolved Hide resolved
@DirectXMan12
Copy link
Contributor

Also, please delete the comments (the stuff between <!-- and -->) from the PR template (as mentioned in the PR template text)

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 22, 2019
@xrmzju
Copy link
Member Author

xrmzju commented Oct 22, 2019

Also, please delete the comments (the stuff between <!-- and -->) from the PR template (as mentioned in the PR template text)

done

@xrmzju
Copy link
Member Author

xrmzju commented Oct 22, 2019

/assign @DirectXMan12

@alexeldeib
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 3, 2019
@DirectXMan12 DirectXMan12 changed the title 🏃 use ResyncPeriod func in case of multi controllers list simultaneously ✨ use ResyncPeriod func in case of multi controllers list simultaneously Dec 3, 2019
@DirectXMan12 DirectXMan12 changed the title ✨ use ResyncPeriod func in case of multi controllers list simultaneously ✨ add 10% jitter to ResyncPeriod Dec 4, 2019
@DirectXMan12
Copy link
Contributor

editted title to reflect current state

/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 Dec 4, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DirectXMan12, xrmzju

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 Dec 4, 2019
@k8s-ci-robot k8s-ci-robot merged commit f7e674b into kubernetes-sigs:master Dec 4, 2019
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use ResyncPeriod func in case of multi controllers list simultaneously
5 participants