Skip to content

Do not resume job that we are waiting to delete and recreate - #353

Merged
brandond merged 1 commit into
k3s-io:masterfrom
brandond:no-resume-unsynced
Sep 4, 2026
Merged

Do not resume job that we are waiting to delete and recreate#353
brandond merged 1 commit into
k3s-io:masterfrom
brandond:no-resume-unsynced

Conversation

@brandond

@brandond brandond commented Sep 2, 2026

Copy link
Copy Markdown
Member

If a change is made that would trigger a recreate of the job while the job is waiting to be observed by the job controller, the chart controller may resume the job and then delete and recreate it in quick succession.

The job is eligible for deletion as soon as conditions are present and there are no active or terminating pods - all of which are satisfied at the same time as the job is eligible to be resumed. This quick resume-and-recreate will trigger the same bug in the job controller that we have been trying to avoid.

Work around this by adding an annotation to the job when we are waiting to replace it, and check for this annotation and do not resume the job if it is present.

Adds another test that uses a custom job manager and finalizer so that the test can control the conditions and deletion of the job.

Linked issues:

  • SURE-11942

@brandond
brandond force-pushed the no-resume-unsynced branch 6 times, most recently from c244db8 to 5efabac Compare September 3, 2026 05:59
@brandond
brandond force-pushed the no-resume-unsynced branch 2 times, most recently from 4a0bb37 to a215d32 Compare September 3, 2026 17:22
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
@brandond
brandond merged commit 71be499 into k3s-io:master Sep 4, 2026
5 checks passed
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 this pull request may close these issues.

2 participants