client-go icon indicating copy to clipboard operation
client-go copied to clipboard

Suppress duplicates between FIFO and priority queue of waiting items

Open narendramadanapalli opened this issue 2 years ago • 2 comments

What type of PR is this?

/kind bug

What this PR does / why we need it:

Fixes #110642

Which issue(s) this PR fixes:

delaying queue suppresses duplicates within the FIFO, and suppresses duplicates within the priority queue of waiting items, but does not suppress duplicates between them.

These changes suppress duplicates within each of those two queues so that an item already being processed in the FIFO is not added again to the priority queue; which eliminates double processing a single item. The change adds a new function Find on the FIFO queue to find if an item is already present in the queue or being processed. The priority queue checks the duplicates by using Find before adding an item to the priority queue.

Special notes for your reviewer:

NONE

Does this PR introduce a user-facing change?

NONE

narendramadanapalli avatar Aug 14 '22 10:08 narendramadanapalli

Hi @narendramadanapalli. 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 /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 avatar Aug 14 '22 10:08 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: narendramadanapalli Once this PR has been reviewed and has the lgtm label, please assign lavalamp for approval by writing /assign @lavalamp in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 avatar Aug 14 '22 10:08 k8s-ci-robot

Hello @lavalamp and @liggitt, Can I get reviews on this PR? Thanks!

narendramadanapalli avatar Aug 20 '22 06:08 narendramadanapalli

I do not believe this is safe. Commented on the issue: https://github.com/kubernetes/kubernetes/issues/110642#issuecomment-1230897214

lavalamp avatar Aug 29 '22 21:08 lavalamp

OK, I'm sorry but I didn't realize until just now that https://github.com/kubernetes/kubernetes/pull/112328 is similar to this one. It's essentially done, so I think we'll go with that one. Thanks for your effort and I'm sorry we didn't understand what was going on right away.

BTW this is in the wrong place, this repo is published from the main kubernetes repo, changes need to go there-- that may explain why no one saw this for a long time.

lavalamp avatar Oct 13 '22 19:10 lavalamp