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

Port waitForSynchronization feature from addon-operator #212

Open
diafour opened this issue Nov 18, 2020 · 1 comment · Fixed by #261
Open

Port waitForSynchronization feature from addon-operator #212

diafour opened this issue Nov 18, 2020 · 1 comment · Fixed by #261
Milestone

Comments

@diafour
Copy link
Contributor

diafour commented Nov 18, 2020

The problem:

- name: pods-in-separate-queue
  apiVersion: v1
  kind: Pod
  # default behaviour
  executeHookOnSynchronization: true
  executeHookOnEvent: ["Added"]
  queue: pods-queue

If this hook fails on Synchronization, "Added" tasks will be queued and executed in the "pods" queue, despite the "Synchronization" task restarting in the "main" queue.

Logs:

{"binding":"pods-in-separate-queue","event":"kubernetes","hook":"with-error.sh","level":"error","msg":"Hook failed. Will retry after delay. Failed count is 14. Error: with-error.sh FAILED: exit status 1","queue":"main","task":"HookRun","time":"2020-11-18T09:46:19Z"}
...
{"binding":"schedule","event.id":"af7e05c0-729f-411e-92f9-d9cfe4f1deca","level":"info","msg":"queue task HookRun:pods-in-separate-queue:kubernetes:with-error.sh:pods-queue","operator.component":"handleEvents","queue":"pods-queue","task.id":"663cc695-7407-4210-8467-76d5b99a328a","time":"2020-11-18T09:46:49Z"}
...
{"binding":"pods-in-separate-queue","event":"kubernetes","hook":"with-error.sh","level":"info","msg":"Execute hook","queue":"pods-queue","task":"HookRun","time":"2020-11-18T09:46:50Z"}
{"binding":"pods-in-separate-queue","event":"kubernetes","hook":"with-error.sh","level":"info","msg":"BC: Got Event Added for 'pods-in-separate-queue'","output":"stdout","queue":"pods-queue","task":"HookRun","time":"2020-11-18T09:46:51Z"}
...
{"binding":"pods-in-separate-queue","event":"kubernetes","hook":"with-error.sh","level":"info","msg":"BC: Got Synchronization for 'pods-queue' with 12 objects","output":"stdout","queue":"main","task":"HookRun","time":"2020-11-18T09:46:51Z"}
...
{"binding":"pods-in-separate-queue","event":"kubernetes","hook":"with-error.sh","level":"error","msg":"Hook failed. Will retry after delay. Failed count is 15. Error: with-error.sh FAILED: exit status 1","queue":"main","task":"HookRun","time":"2020-11-18T09:46:51Z"}

This problem is already solved in addon-operator by waitForSynchronization option. See flant/addon-operator#111.

@diafour diafour added this to the 1.0.0 milestone Mar 31, 2021
@diafour diafour linked a pull request Mar 31, 2021 that will close this issue
@diafour
Copy link
Contributor Author

diafour commented Mar 31, 2021

#250 brings some changes: "Added" tasks will not be queued until successful Synchronization.

I think we can revisit this for the 1.1.0 version to implement "Synchronization" in parallel queues.

@diafour diafour modified the milestones: 1.0.0, 1.1.0 Mar 31, 2021
@diafour diafour modified the milestones: 1.1.0, future Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant