-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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 GC workqueue Forget
to stop the rate limiter
#106029
Conversation
Hi @astraw99. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
/assign @deads2k @caesarxuchao |
b4ff47a
to
ebd15e3
Compare
0241e7a
to
2e39519
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.
I cannot comment outside the diff, but in the cases where we are not adding back to the queue, why shouldn't we .Forget
? A standard controller does the forget in a layer outside the worker itself (example: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-api-machinery/controllers.md#rough-structure).
I think it may be cleaner to model it like this. @caesarxuchao what do you think?
a7c67a4
to
a430179
Compare
@deads2k @caesarxuchao PTAL thanks. |
This is a good catch. I'm wondering if it's caused because the structure doesn't follow https://github.com/kubernetes/community/blame/master/contributors/devel/sig-api-machinery/controllers.md#L146-L190 . If we followed that pattern of "return an error to requeue, return nil to be forgotten" we could side-step all the edge cases we're catching with one-off's here, right? |
Good catch. There is no call to Forget() in the entire GC code base. Perhaps the GC code was written before the
That would be ideal but I don't see a clear way to refactor all three non-conforming cases:
I feel it's not worth to refactor. |
I gave the refactor a try and it got sticky for cases where we want to requeue, but we do not want a message in the log. this happens on RESTMapper errors for instance. Lacking a refactor, I think we need to go through every return and either add
It's painful, but I think it's the only way to help us avoid misses. For instance, in |
a430179
to
b26157f
Compare
@deads2k @caesarxuchao Tried to make a refactor, PTAL thanks. |
This is back on reviewers plate! author has already incorporated suggestions. |
b26157f
to
df5db0a
Compare
Working through some factorization tweaks on slack with the author. |
6a29c18
to
7e4fe39
Compare
7e4fe39
to
a5a5475
Compare
Great find and good job on the fix. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: astraw99, deads2k 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
In controller sync func, after the workqueue item
AddRateLimited
, we needForget
to stop the rate limiter from tracking it if the sync finished without error.Does this PR introduce a user-facing change?