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
Fix JobTrackingWithFinalizers when a pod succeeds after the job fails #111646
Fix JobTrackingWithFinalizers when a pod succeeds after the job fails #111646
Conversation
/sig apps |
/priority critical-urgent |
/assign @soltysh |
/milestone v1.25 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
for test due to the urgency but deferring lgtm/review to *Job owners.
release notes should ideally exclude code details and cover what users might see as a bug and post the fix. |
which part of the note do you think has code details? JobTrackingWithFinalizers is a feature gate, so user-visible. Should I remove the "which led to API conflicts" part? |
@@ -1023,7 +1023,7 @@ func (jm *Controller) trackJobStatusAndRemoveFinalizers(ctx context.Context, job | |||
if podFinished || podTerminating || job.DeletionTimestamp != nil { | |||
podsToRemoveFinalizer = append(podsToRemoveFinalizer, pod) | |||
} | |||
if pod.Status.Phase == v1.PodSucceeded { | |||
if pod.Status.Phase == v1.PodSucceeded && !uncounted.failed.Has(string(pod.UID)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regarding the comment above at line 1018, are we counting them as failed because we may not get another job sync to remove their finalizers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, that is covered in line 1020.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is nit, but I don't think it is covered in that comment if the sole purpose is to "trigger another sync to remove the finalizers".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
/hold
to get the integration sorted out
/triage accepted |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, neolit123, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
4c47e2b
to
b214d56
Compare
Change-Id: I3be351fb3b53216948a37b1d58224f8fbbf22b47
b214d56
to
ca8cebe
Compare
Fixed the integration test. If the finalizers were removed before setting pods to Succeeded, apiserver would delete the pods, because they were unscheduled. Solved by adding a NodeName directly into the pod template. |
/hold cancel |
/lgtm |
…of-#111646-upstream-release-1.23 Automated cherry pick of #111646: Fix JobTrackingWithFinalizers when a pod succeeds after the
…of-#111646-upstream-release-1.24 Automated cherry pick of #111646: Fix JobTrackingWithFinalizers when a pod succeeds after the
What type of PR is this?
/kind bug
/kind regression
What this PR does / why we need it:
When JobTrackingWithFinalizers is enabled, this sequence of steps led to a failure:
.status.uncountedTerminatedPods.failed
.The fix is to check if a succeeded pod was considered as failed before and stick with that decision.
Which issue(s) this PR fixes:
Ref kubernetes/enhancements#2307
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: