+
Skip to content

Conversation

martin-kanis
Copy link
Contributor

Closes #34093

Copy link
Contributor

@ahus1 ahus1 left a comment

Choose a reason for hiding this comment

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

Thank you for this PR. This is due to the nested iteration and removal. Instead of using the ConcurrentHashMap, I suppose it is more straightforward to change JpaChangesPerformer.java line 547 from

userSessionModel.getNotes().forEach((k, v) -> userSessionModel.removeNote(k));

to

userSessionModel.getNotes().clear();

as that would be the real delegator of the method without side effects.

@martin-kanis martin-kanis force-pushed the 34093-CME-session-restart branch from 9cdb5a9 to 0ee788c Compare October 24, 2024 08:37
pedroigor
pedroigor previously approved these changes Oct 24, 2024
ahus1
ahus1 previously approved these changes Oct 24, 2024
Copy link
Contributor

@ahus1 ahus1 left a comment

Choose a reason for hiding this comment

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

Thank you for this PR!

@martin-kanis
Copy link
Contributor Author

@ahus1 As I expanded the existing test, it's failing with external infinispan. It seems, restarting sessions doesn't work correctly. User sessions notes are not cleared.
I can investigate that, but probably next week as I'm about to switch to PTO. Any pointers are appreciated.

@martin-kanis
Copy link
Contributor Author

@ahus1 As I expanded the existing test, it's failing with external infinispan. It seems, restarting sessions doesn't work correctly. User sessions notes are not cleared. I can investigate that, but probably next week as I'm about to switch to PTO. Any pointers are appreciated.

OK I figured that out. Changes are propagated to the external Infinispan just after end of a transaction. So I adjusted the test accordingly.

Closes keycloak#34093

Signed-off-by: Martin Kanis <mkanis@redhat.com>
Copy link

@keycloak-github-bot keycloak-github-bot bot left a comment

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.federation.kerberos.KerberosLdapCrossRealmTrustTest#test03SpnegoLoginUsernamePassword

Keycloak CI - Base IT (5)

org.openqa.selenium.TimeoutException: 
java.net.SocketTimeoutException: Read timed out
Build info: version: '4.25.0', revision: '8a8aea2337'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-1025-azure', java.version: '21.0.4'
Driver info: driver.version: HtmlUnitDriver
...

Report flaky test

Copy link
Contributor

@ahus1 ahus1 left a comment

Choose a reason for hiding this comment

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

Thank you for the fix and for figuring out the cause!

@ahus1 ahus1 merged commit 4f3ced9 into keycloak:main Oct 24, 2024
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

java.util.ConcurrentModificationException when process user sessions update

4 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载