8000 Upgrade to Quarkus 3.14.2 by vmuzikar · Pull Request #32519 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Upgrade to Quarkus 3.14.2 - #32519

Merged
vmuzikar merged 1 commit into
keycloak:mainfrom
vmuzikar:quarkus-3141
Sep 13, 2024
Merged

vmuzikar merged 1 commit into
keycloak:mainfrom
vmuzikar:quarkus-3141

Conversation

@vmuzikar
@vmuzikar vmuzikar commented Aug 30, 2024 •
Copy link
Copy Markdown
Contributor

Closes #32517
Closes #32198 (edited by @mabartos)

Quarkus 3.14 introduced a bunch of (hidden) breaking changes.

Oracle Driver extension

The extension now touches some of the driver classes in a recorder. This revealed how fragile is our approach with quarkus.class-loading.removed-artifacts. It turned out that option does not seem to be reflected until the server is reaugmented. What happens when the server is started without augmenting it first (i.e. when doing kc.sh start --optimized) is that the recorder is executed at the server start but it tries to use the DB driver classes that are not part of our dist.

The solution to that was to add a validation that needs to be built first. I believe this is reasonable as it's what we document users need to do anyway.

Still, I find the approach to exclude a Quarkus extension using quarkus.class-loading.removed-artifacts very fragile and I'll open a discussion with the Quarkus team about it.

Hibernate upgrade

The Hibernate upgrade made it to be more strict and less forbidding and as a result it throws exception in some cases where we were not perhaps following best practices.

This required some changes especially in how we handle composite roles.

Liquibase upgrade

The Liquibase upgrade seems to have caused some issues around transactions. Added a workaround for that.

Regression in H2 (unresolved yet)

See #32785

@mabartos
Copy link
Copy Markdown
Member

@vmuzikar Please accommodate changes to the SmallRye Health config root (https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.14#smallrye-health).

Changing from quarkus.health.extensions.enabled => quarkus.smallrye-health.extensions.enabled

Thanks!

keycloak-github-bot[bot]

This comment was marked as outdated.

@keycloak-github-bot

This comment was marked as outdated.

@keycloak-github-bot

This comment was marked as outdated.

keycloak-github-bot[bot]

This comment was marked as outdated.

keycloak-github-bot[bot]

This comment was marked as outdated.

@keycloak-github-bot

This comment was marked as outdated.

keycloak-github-bot[bot]

This comment was marked as outdated.

@keycloak-github-bot

This comment was marked as outdated.

keycloak-github-bot[bot]

This comment was marked as outdated.

@keycloak-github-bot

This comment was marked as outdated.

keycloak-github-bot[bot]

This comment was marked as outdated.

@keycloak-github-bot

This comment was marked as outdated.

@mabartos
mabartos commented Sep 4, 2024
Copy link
Copy Markdown
Member

@vmuzikar jfyi - I'm a little bit worried about the 409 Conflict flakiness. Could you please check them as well once you finish the work on this?

@keycloak-github-bot

This comment was marked as outdated.

keycloak-github-bot[bot]

This comment was marked as outdated.

@vmuzikar
vmuzikar marked this pull request as ready for review September 6, 2024 15:44
@vmuzikar
vmuzikar requested review from a team as code owners September 6, 2024 15:44
@mabartos
mabartos commented Sep 7, 2024 •
Copy link
Copy Markdown
Member

I'd like to resolve it as a follow up to not hold the upgrade any longer. WDYT @mabartos?

Yes, definitely. If you've verified there's no other additional regression, I'm ok with that. Thanks!

@mabartos
mabartos commented Sep 7, 2024
Copy link
Copy Markdown
Member

@vmuzikar I have not looked at it much yet, but as the PR touches a lot of different stuff, it'd be good to track it somehow - creating separate issues and referencing them? Perhaps provide more information to the commit message as well.

@vmuzikar
vmuzikar commented Sep 9, 2024
Copy link
Copy Markdown
Contributor Author

@mabartos I'm not sure if we should create more issues as they are not really relevant without the Quarkus upgrade. I tried to provide most details in the PR description. Does that work for you?

Once we're ready for the final review, I plan to tag other codeowners of the code I touched.

@mabartos mabartos left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@vmuzikar Nice job! Quarkus side looks fine to me. As you've mentioned, it's necessary to involve more eyes on this - even maybe outside of our team.

Comment on lines +459 to +461
Stream<RoleEntity> parentRoles = em.createNamedQuery("getParentRolesOfACompositeRole", RoleEntity.class).setParameter("compositeRole", roleEntity).getResultStream();
parentRoles.forEach(parentRole -> parentRole.getCompositeRoles().remove(roleEntity));
parentRoles.close();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't there any better approach how to achieve it? Perhaps ask someone from the Hibernate team?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did not talked with the Hibernate team yet. Let's wait first for the core team's review. :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't have better idea either. Thanks for adding the comment as that can be useful for the future references.

@vmuzikar
Copy link
Copy Markdown
Contributor Author

Spent some more time debugging the flaky hostname test and turned out to be much deeper issue: #32785.

Nevertheless, since it affects just H2, I'd like to still proceed with the PR. WDYT?

@vmuzikar
Copy link
Copy Markdown
Contributor Author

Given the nature of the changes, adding more reviewers.

@Pepo48 Pepo48 left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with merging this and sorting out the H2 issue as a follow-up. Thanks @vmuzikar for the relentless work that you've put into this. From my perspective it looks fine at it's current state.

@ahus1 ahus1 left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thank you for those investigations.

I read up on why we remove the user attributes and other the way we do it. I agree it works, still it looks quite non-standard. Still I don't have a better idea.

I agree that removed-artifacts is probably an edge case for Quarkus, and it would simplify our code base not to use it.

About the H2 update: I looked at the H2 GitHub repository and saw that there is no open issue that I would connect to this, and no changes after the release look to be connect to that. And the release we're using seems to be quite fresh. I suggest to open an issue with the H2 team with details you can share. Maybe they can recommend some additional logging on the H2 level.

@vmuzikar
Copy link
Copy Markdown
Contributor Author

I suggest to open an issue with the H2 team with details you can share. Maybe they can recommend some additional logging on the H2 level.

@ahus1 In the meantime, it turned out the issue is not reproducible with Undertow. That suggest rather Quarkus issue than H2.

@mposolda mposolda left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving. +1 to handle H2 issue as a follow-up.

Review from some DB guru (which I don't consider myself to be) won't hurt, but at the same time, it can be probably good to have this PR ASAP, so we have time to catch potential issues before the Keycloak 26.

Comment on lines +459 to +461
Stream<RoleEntity> parentRoles = em.createNamedQuery("getParentRolesOfACompositeRole", RoleEntity.class).setParameter("compositeRole", roleEntity).getResultStream();
parentRoles.forEach(parentRole -> parentRole.getCompositeRoles().remove(roleEntity));
parentRoles.close();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't have better idea either. Thanks for adding the comment as that can be useful for the future references.

@shawkins shawkins left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks @vmuzikar

@vmuzikar
Copy link
Copy Markdown
Contributor Author

Thank you for the reviews! I will go ahead and merge this later today as we should start testing with this soon to see if there are any hidden issues. We can do improvements as a follow-up.

@vramik vramik left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thank you @vmuzikar.

@vmuzikar
vmuzikar merged commit 83c0073 into keycloak:main Sep 13, 2024
@vmuzikar
Copy link
Copy Markdown
Contributor Author

Merged. Thank you all involved and please keep your fingers 🤞 it doesn't cause (too many) so far hidden regressions. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

7 participants

0