Skip to content
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: dependent event handling with temp cache not cleared in some corner cases #1994

Merged
merged 6 commits into from
Aug 7, 2023

Conversation

csviri
Copy link
Collaborator

@csviri csviri commented Aug 4, 2023

No description provided.

@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 Aug 4, 2023
@csviri csviri self-assigned this Aug 4, 2023
// if the resource is not added to the temp cache, it is cleared, since
// the cache is cleared by subsequent events after updates, but if those did not received
// the temp cache is still filled at this point with an old resource
log.debug("Cleaning temporal cache for resource id: {}", resourceID);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@shawkins this will always clear the temp cache if not propagated.

@csviri csviri marked this pull request as ready for review August 4, 2023 14:12
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 4, 2023
@csviri csviri changed the title improvemetns: dependent event handling improve: dependent event handling Aug 4, 2023
@csviri csviri changed the title improve: dependent event handling fix: dependent event handling with temp cache not cleared in some corner cases Aug 4, 2023
@csviri csviri requested a review from metacosm August 4, 2023 14:34
@@ -138,15 +142,23 @@ public R create(R target, P primary, Context<P> context) {
}

public R update(R actual, R target, P primary, Context<P> context) {
if (log.isDebugEnabled()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why check if debug login is enabled here and not elsewhere?

Copy link
Collaborator Author

@csviri csviri Aug 7, 2023

Choose a reason for hiding this comment

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

Since creating a new object in that case: ResourceID.fromResource(actual). Want to do that only if really needed

@@ -277,22 +280,32 @@ private void handleRecentResourceOperationAndStopEventRecording(Operation operat
R newResource, R oldResource) {
ResourceID resourceID = ResourceID.fromResource(newResource);
try {
// what if the prev event delayed, thus that even did not clear the temp cache.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand this comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed that, just probably some note for myself. good catch :)

csviri and others added 3 commits August 7, 2023 10:46
…tor/processing/dependent/kubernetes/KubernetesDependentResource.java

Co-authored-by: Chris Laprun <[email protected]>
…tor/processing/event/source/informer/InformerEventSource.java

Co-authored-by: Chris Laprun <[email protected]>
@csviri csviri requested a review from metacosm August 7, 2023 08:58
@csviri csviri merged commit f936a51 into main Aug 7, 2023
17 checks passed
@csviri csviri deleted the cache-issue-keycloak branch August 7, 2023 09:49
@vmuzikar
Copy link
Contributor

vmuzikar commented Aug 29, 2023

jFYI – this change seem to cause issues with K8s <1.23. But that should be ok as even 1.23 is quite old by now and unsupported.

@metacosm
Copy link
Collaborator

I guess our tests do not cover this change properly because this was tested without errors on 1.23…

@vmuzikar
Copy link
Contributor

1.23 fixes it. You need to be on <1.23, we discovered it with 1.22.

@csviri
Copy link
Collaborator Author

csviri commented Aug 29, 2023

@vmuzikar could you pls create a new issue and provide some additional information, ideally also logs, but instructions to reproduce would help too. thx!

@vmuzikar
Copy link
Contributor

I can create an issue but does JOSDK really support this old K8s versions? :)

@csviri
Copy link
Collaborator Author

csviri commented Aug 29, 2023

We are not testing it now, there is now also a discussion, that if we should support older versions, or just the versions what also Kubernetes supports. What is the strategy of KeyCloak on this @vmuzikar ? :)

@vmuzikar
Copy link
Contributor

What is the strategy of KeyCloak

Formally ,we're aligned with the OCP lifecycle. The oldest supported version now will be 4.11 which translates to K8s 1.24.

@csviri
Copy link
Collaborator Author

csviri commented Aug 29, 2023

Thank you @vmuzikar

@vmuzikar
Copy link
Contributor

The issue is actually already reported here (which I missed before): #2033

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.

Investigate issues with caching related to Dependent Resources in Keycloack Operator
3 participants