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

No immediate reaction on changes/deletion if sleeping for retries #161

Closed
kopf-archiver bot opened this issue Aug 18, 2020 · 0 comments
Closed

No immediate reaction on changes/deletion if sleeping for retries #161

kopf-archiver bot opened this issue Aug 18, 2020 · 0 comments
Labels
archive bug Something isn't working

Comments

@kopf-archiver
Copy link

kopf-archiver bot commented Aug 18, 2020

An issue by nolar at 2019-08-02 00:19:14+00:00
Original URL: zalando-incubator/kopf#161
 

Expected Behavior

When a handler function raises an exception, it is scheduled to be retried later (by default, in 60 seconds). Other handlers will be invoked — until the state is reached, when all the remaining handlers are scheduled for later.

When a handler with an exception or a retry is scheduled for later execution, and its operator is sleeping until the time comes, and a new watch-event arrives — the sleep must be interrupted, and a new state must be processes immediately, not after few tens of seconds.

Actual Behavior

Kopf uses unconditional asyncio.sleep() with the shortest duration until the next handler to be awakened.

If new events arrive for that object — e.g. it was changed or deleted — the sleep continues unconditionally, and the new events are processes much later.

Steps to Reproduce the Problem

import kopf

@kopf.on.create('zalando.org', 'v1', 'kopfexamples')
def create(**_):
    raise Exception("oops")
  1. Run the operator in the background.
  2. Create an object.
  3. Within the next 60 seconds (default timeout), delete the object.
  4. Observe: the deletion is frozen until the operator reaches its 60s timing.

Specifications

kopf==0.20
@kopf-archiver kopf-archiver bot closed this as completed Aug 18, 2020
@kopf-archiver kopf-archiver bot changed the title [archival placeholder] No immediate reaction on changes/deletion if sleeping for retries Aug 19, 2020
@kopf-archiver kopf-archiver bot added the bug Something isn't working label Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archive bug Something isn't working
Projects
None yet
Development

No branches or pull requests

0 participants