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

AddAfter should be able to cancel previous enqueues of the same key #131

Open
0xmichalis opened this issue Feb 25, 2017 · 7 comments
Open
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@0xmichalis
Copy link
Contributor

https://github.com/kubernetes/client-go/blob/master/util/workqueue/delaying_queue.go

Case:

  1. Deployment with ProgressDeadlineSeconds=600 is using AddAfter to be synced after 600s so we can check if it has progressed or not.
  2. If the Deployment progresses in the meantime (one of its RSs is scaled up/down, one of its Pods becomes ready, etc) , we should postpone the ProgressDeadlineSeconds check for the next 600s.
  3. As is, the initial AddAfter call will enqueue the Deployment but it is unnecessary. Ideally it should be cancelled as soon as another invocation of AddAfter with the same key happens.

I have another use case with ReplicaSets and MinReadySeconds.

Go has a func that seems to be doing what I am asking for
https://golang.org/pkg/time/#AfterFunc

If the delaying queue is meant to work as is currently then how about a new queue type that does what I need?

@deads2k

k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this issue Feb 28, 2017
…replicas

Automatic merge from submit-queue

Enqueue controllers after minreadyseconds when all pods are ready

@janetkuo this should address #41697 (comment). Impossible to unit test this but it should stabilize some of our deployment e2e tests that occasionally fail because of availableReplicas not being updated.

It should also fix #41641

Eventually I would like AddAfter to be able to cancel previous invocations of the same key so I opened kubernetes/client-go#131

@kubernetes/sig-apps-bugs
@caesarxuchao
Copy link
Member

As is, the initial AddAfter call will enqueue the Deployment but it is unnecessary. Ideally it should be cancelled as soon as another invocation of AddAfter with the same key happens.

I hope another invocation of Add with the same key would also cancel the AddAfter. I don't want to process the same item twice. My use case is kubernetes/kubernetes#43032.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 22, 2017
@0xmichalis
Copy link
Contributor Author

/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Dec 22, 2017
@0xmichalis 0xmichalis removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 5, 2018
@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. and removed enhancement labels Jun 5, 2018
openshift-publish-robot pushed a commit to openshift/kubernetes-client-go that referenced this issue May 21, 2020
…18.3

Bump to kubernetes v1.18.3

Kubernetes-commit: 8e3449361348b1ab53198c449eb7764436eadfa9
@soulseen
Copy link

/remove-lifecycle stale

@soulseen
Copy link

Any progress about this issue?

@atiratree
Copy link
Member

proposing this in kubernetes/kubernetes#113607

@atiratree
Copy link
Member

I had to close my PR since it clashes with kubernetes/kubernetes#112328, which is trying to introduce more rich functionality/interface to the delaying queue. Continuing a discussion there to get a consensus on the cancel functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants