Merge pull request #111026 from alculquicondor/job-conflicts

Do not skip job requeue in conflict error
This commit is contained in:
Kubernetes Prow Robot 2022-07-08 13:23:46 -07:00 committed by GitHub
commit eba254b4ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -537,12 +537,7 @@ func (jm *Controller) processNextWorkItem(ctx context.Context) bool {
}
utilruntime.HandleError(fmt.Errorf("syncing job: %w", err))
if !apierrors.IsConflict(err) {
// If this was a conflict error, we expect a Job or Pod update event, which
// will add the job back to the queue. Avoiding the rate limited requeue
// saves an unnecessary sync.
jm.queue.AddRateLimited(key)
}
jm.queue.AddRateLimited(key)
return true
}

View File

@ -2007,11 +2007,13 @@ func TestSyncJobUpdateRequeue(t *testing.T) {
wantRequeue: true,
},
"conflict error": {
updateErr: apierrors.NewConflict(schema.GroupResource{}, "", nil),
updateErr: apierrors.NewConflict(schema.GroupResource{}, "", nil),
wantRequeue: true,
},
"conflict error, with finalizers": {
withFinalizers: true,
updateErr: apierrors.NewConflict(schema.GroupResource{}, "", nil),
wantRequeue: true,
},
}
for name, tc := range cases {