-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
non-functioning session persistence when using JDBC over Infinispan #24766
Comments
It is probably a duplicate of this issue: #10803 |
@miroRucka - thank you for sharing this context. To reproduce this locally, I need a Infinispan XML configuration to test this. I know that the Stackoverflow issue you linked contains one, but to really reproduce the case I'd like to see more about your setup. It would also help to see the PostgreSQL configuration you're using. A full CLI example and a configuration on how to prepare the PostgreSQL for your example would help as well. |
Closes keycloak#10803 Closes keycloak#24766 Signed-off-by: Alexander Schwartz <aschwart@redhat.com> Co-authored-by: daviddelannoy <16318239+daviddelannoy@users.noreply.github.com>
Closes keycloak#10803 Closes keycloak#24766 Signed-off-by: Alexander Schwartz <aschwart@redhat.com> Co-authored-by: daviddelannoy <16318239+daviddelannoy@users.noreply.github.com> Signed-off-by: ShefeeqPM <86718986+ShefeeqPM@users.noreply.github.com>
Before reporting an issue
Area
infinispan
Describe the bug
Hello, I recently created a pull request regarding the issue of storing user sessions into the JDBC data layer through Infinispan. The PR also describes a use case.
PR link:
#24248
PR description:
The problem arises when the persistent jdbc layer is used to save the session. After logging in, the user session is only stored in memory and is not stored in the relational database as I would expect. However, in rare cases the saving works, but it was very accidental. After studying the integration code on infinispan, I discovered that the cache instance always returns with the SKIP_CACHE_STORE flag, which actually results in the avoidance of persistence. It complicates the use of keycloak for us, because after a restart, users are always logged out both on mobile devices and on websites. I have tested this fix and user sessions persist immediately after logging in. If you know another way to fix it, let me know, if there is no other way, it would be good to reconsider the purpose of the SKIP_CACHE_STORE flag. Well thank you.
I found the same problem on a forum as well. Also, there is a recorded response that describes the modification of CacheDecorators and a problematic flag.
Here is link:
https://stackoverflow.com/questions/76661708/infinispan-doesnt-write-any-sessions-in-jdbc-persisted-cache-in-keycloak-21-0-2
Please try to look into it to see if it is correct behavior, thank you.
Version
21.1.2
Expected behavior
I expect that with each login, sessions will be saved to the database and will not be lost upon restarting KC.
Actual behavior
Currently, the saving is random and in most cases, the session is not saved, resulting in users being logged out after a restart.
How to Reproduce?
o simulate the problem, it is necessary to run KC with ISPN and JDBC configuration, for example on a Postgres DB, then perform a login and check the table where sessions are stored. I would perform the login multiple times with different users, as sometimes the session is recorded.
Anything else?
No response
The text was updated successfully, but these errors were encountered: