Skip to content

fix: deletion not reconciled when merged into eventFilteringUpdate response#3394

Open
xstefank wants to merge 1 commit into
operator-framework:mainfrom
xstefank:resource-delete-informer-miss
Open

fix: deletion not reconciled when merged into eventFilteringUpdate response#3394
xstefank wants to merge 1 commit into
operator-framework:mainfrom
xstefank:resource-delete-informer-miss

Conversation

@xstefank
Copy link
Copy Markdown
Collaborator

@xstefank xstefank commented Jun 4, 2026

Copilot AI review requested due to automatic review settings June 4, 2026 12:33
@openshift-ci openshift-ci Bot requested review from csviri and metacosm June 4, 2026 12:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a regression where a resource deletion could be missed when it races with a status update performed via eventFilteringUpdateAndCacheResource, causing finalizer cleanup not to be triggered (ref: quarkiverse/quarkus-operator-sdk#1353).

Changes:

  • Add a fallback path in ManagedInformerEventSource#eventFilteringUpdateAndCacheResource to trigger reconciliation when the update response is marked for deletion but no new event is emitted after filtering.
  • Introduce a new regression integration test scenario that reproduces the “delete during status patch” race and asserts that cleanup() is invoked.
  • Add minimal test CR + status model classes to support the new regression test.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/ManagedInformerEventSource.java Adds fallback reconciliation trigger when deletion is merged into an update response but the corresponding delete event is filtered/dropped.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/deletionduringstatusupdate/DeletionDuringStatusUpdateIT.java New regression IT validating cleanup is triggered when delete races with a status update.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/deletionduringstatusupdate/DeletionDuringStatusUpdateReconciler.java Test reconciler that blocks inside a status patch to widen the race window and exposes latches to the test.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/deletionduringstatusupdate/DeletionDuringStatusUpdateCustomResource.java Test custom resource model used by the regression IT.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/deletionduringstatusupdate/DeletionDuringStatusUpdateStatus.java Test status POJO used by the regression IT.

Comment on lines +146 to +159
// If the resource was marked for deletion concurrently with this update, the deletion
// event arrived at a lower RV than the update result and was deferred then dropped by
// doneEventFilterModify (deferred RV < lastOwnUpdatedRV). The API server merges the
// deletionTimestamp into the update response, so updatedForLambda already carries it,
// but no event was propagated to the reconciler. Trigger one now so the finalizer can
// be removed.
if (updatedForLambda != null
&& updatedForLambda.isMarkedForDeletion()
&& !resourceToUpdate.isMarkedForDeletion()) {
log.debug(
"Resource {} was marked for deletion during update, triggering reconciliation",
id);
handleEvent(ResourceAction.UPDATED, updatedForLambda, resourceToUpdate, null);
}
@xstefank xstefank force-pushed the resource-delete-informer-miss branch from 825b4ef to 6b1785b Compare June 4, 2026 12:46
…sponse

Signed-off-by: xstefank <xstefank122@gmail.com>
@xstefank xstefank force-pushed the resource-delete-informer-miss branch from 6b1785b to 0d7c35d Compare June 4, 2026 12:54
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.

Operator intermittently never processes resource deletion — informer misses events, finalizer stays forever

2 participants