Skip to content

Commit 3bc8654

Browse files
committed
comment
Signed-off-by: Attila Mészáros <[email protected]>
1 parent 5cf7d41 commit 3bc8654

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,12 @@ public P conflictRetryingPatch(
381381
} catch (KubernetesClientException e) {
382382
log.trace("Exception during patch for resource: {}", resource);
383383
retryIndex++;
384-
// only retry on conflict (HTTP 409), otherwise fail
384+
// only retry on conflict (409) and unprocessable content (422) what
385+
// can happen if JSON Patch is not a valid request since there was
386+
// a concurrent request already removed another finalizer:
387+
// List element removal from a list is by index in JSON Patch
388+
// so if addressing a second finalizer but first is meanwhile removed
389+
// it is a wrong request.
385390
if (e.getCode() != 409 && e.getCode() != 422) {
386391
throw e;
387392
}

0 commit comments

Comments
 (0)