Skip to content

Conversation

@csviri
Copy link
Collaborator

@csviri csviri commented Dec 25, 2025

  • The PR adds utility that provides methods to update resources using comparable resource versions
  • Integrates this utility to the core of the framework (thus simplifying ReconciliationDispatcher)
    • note that this introduces a change in the behavior for the UpdateControl.patchStatus (and others), since it won't trigger the reconiliation for the event in that update.
  • Renames former ReconcilerUtils to ReconcilerUtilsInternal, this is breaking but that utils was never advertised for non-internal usage
  • Includes also fixes for ControllerEventSource event filtering
  • Improves TemporaryResourceCache so it explicitly supports non filtering updates

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 25, 2025
@csviri csviri requested a review from shawkins December 26, 2025 09:20
@csviri
Copy link
Collaborator Author

csviri commented Dec 26, 2025

@shawkins I changed here the event filtering algorithm; one bit that bothered me with the one on next branch is the locking that is indirectly bound to an I/O operation:

if (lock != null) {
lock.lock(); // wait for the modification to finish
lock.unlock(); // simply unlock as the event is guaranteed after the modification
}

Although in normal case this would not cause to much of a delay in event processing since the event from our update will arrive just after the request is sent. However considering the case when some does an update on the same resource just when we starten our filtering update this might lock the thread for the full duration for the request processing. So I created an alternative implementation (first version, to be refined soon) with our good old friend event recording. Pls take a look if you have the bandwidth, and let me know what do you think. thank you!!

@shawkins
Copy link
Collaborator

shawkins commented Jan 6, 2026

However considering the case when some does an update on the same resource just when we starten our filtering update this might lock the thread for the full duration for the request processing.

That is correct. Until the update is complete, event processing is paused once you hit an event for the same resource. Part of the motivation was this allowed to keep much of the existing calling code structure.

So I created an alternative implementation (first version, to be refined soon) with our good old friend event recording. Pls take a look if you have the bandwidth, and let me know what do you think. thank you!!

There's a lot of changes here, so it may take a bit to fully review. Since we're really just trying to solve the case of the update event delivered prior to the completion of the update operation, things may be able to be simplified a bit. I put some ideas in #3109

Otherwise I think things look good. Having most of the handling localized to eventFilteringUpdateAndCacheResource will keep things more straight-forward.

csviri added 8 commits January 8, 2026 14:34
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
@csviri csviri force-pushed the reconcile-utils-new-alg branch from 7b46752 to be8f5f7 Compare January 8, 2026 13:34
@shawkins shawkins force-pushed the reconcile-utils-new-alg branch from be8f5f7 to 630cde5 Compare January 8, 2026 14:59
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 8, 2026
@csviri
Copy link
Collaborator Author

csviri commented Jan 8, 2026

@shawkins something went wrong with this force push I will revert it here if not objections, could you pls propose changes in you branch? thx

@csviri csviri force-pushed the reconcile-utils-new-alg branch from 630cde5 to be8f5f7 Compare January 8, 2026 15:04
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 8, 2026
@shawkins
Copy link
Collaborator

shawkins commented Jan 8, 2026

@shawkins something went wrong with this force push I will revert it here if not objections, could you pls propose changes in you branch? thx

I'm sorry, I just noticed that I'm tracking the upstream branch for some reason.

// will receive
// additional event
filterEvent = false;
obsoleteEvent = comp == 0;
Copy link
Collaborator Author

@csviri csviri Jan 8, 2026

Choose a reason for hiding this comment

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

This is not right. Note that it is used only if there is no explicit filtering

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can remove that commit from this pr. We can discuss on #3114

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

np, just moved it back for now.

Signed-off-by: Attila Mészáros <[email protected]>
@shawkins shawkins force-pushed the reconcile-utils-new-alg branch from eaa50d1 to 793a56d Compare January 8, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants