-
Notifications
You must be signed in to change notification settings - Fork 7.7k
ConcurrentModificationException when restarting user sessions #34255
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
Conversation
There was a problem hiding this 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.
9cdb5a9
to
0ee788c
Compare
0ee788c
to
ba799a8
Compare
There was a problem hiding this 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!
@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. |
ba799a8
to
84b61c2
Compare
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>
84b61c2
to
8252cf4
Compare
There was a problem hiding this 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
Unreported flaky test detectedIf 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
|
There was a problem hiding this 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!
Closes #34093