-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow Customizing Redis Session Mapper #2021
Comments
Thanks for reaching out @gp0014. I will keep this issue open for now in case someone is able to provide a sample, but without knowing how to reproduce it we won't be able to verify whether we have a fix. |
Same issue is happening for us as well.
|
Thanks @jobinvjohn, do you have a minimal sample that reproduces the issue? |
We experience the same issue after updating to Spring Boot 2.6.6 and spring-session-data-redis 2.6.1. |
I met this problem too. I can't reproduce this error, but I suspect it is caused by session invalidation via spring-session-data-redis version 2.7.0 |
Looking at this, session stored in data store without a creation time looks like a potential issue due to concurrent requests. For example, a request that attempts to invalidate the session while at the same time some other request attempts to update it - delete happens first, and after that update writes only those session attributes that have changed (delta). @LepikhinEgor, would this scenario be something like what you meant when saying:
|
@vpavic - We also noticed something similar(not exact) scenario. That is we had two concurrent requests(from angular code) and both of them are processed properly. But since each request changes the session Id (guess to avoid session fixation) in jdbc store the session id in cookies returned by each of them is different and this resulted in the next requests to fail since the cookie from the one of them is valid session id and other one is invalid and the due to the return time difference the invalid won and got stored. So basically we lost the session and had to authenticate again. Is there some solution to this kind of issue during concurrent requests? |
we are seeing this following an upgrade to Spring Boot 3.0.6 (from 2.7) when using mTLS and concurrent requests. It looks like sessions are getting removed just as they try to get used again |
Continue seeing this with Spring Boot 3.1.1 |
We are seeing it as well |
I managed to work around this but can't remember how and I'm off work until September now. I either changed something on the session config to handle empty beans such as https://fasterxml.github.io/jackson-databind/javadoc/2.9/com/fasterxml/jackson/databind/SerializationFeature.html#FAIL_ON_EMPTY_BEANS or I changed something on the connections such that they where stateless (or I made the server stateless) Sorry for the poor answer I'll try and follow up in September with the actual change I made |
It's September :) |
Thanks for the reminder 🙂 When I debugged it I could see that some sessions where not coming back out of redis correctly and it looked like it might of been a race condition with the same session attempting to be reused or something before it was created. It only happened under load for us. We are using mTLS on our connections and I disabled session management. Well I removed the |
With us, it occurred when Redis flush mode was ON_SAVE. We had a redirect and sometimes the session was not saved correctly in Redis. IMMEDIATE flush mode fixed the problem. |
We are also seeing this intermittently on our production environment. Unfortunately for us, changing the flush mode to |
Happening in the most recent |
I see it has been picked up recently - any updates on this please @marcusdacoregio? |
Hi, @martoncsukas. I'm investigating the possible solutions to this problem, I will update this issue as soon as I have aligned with the team on what would be the viable approach. |
Hi everyone, I have added a new capability in 3.2 where you can create your own implementation of the session mapper. This will be available in |
This issue affected us too with version 3.2.2 of Spring Session. I wish Spring Session had a built-in fix rather than us having to apply the workaround manually. |
Describe the bug
We are using redis to save sessions in spring cloud gateway, and see some missing key errors in the log.
Versions:
spring-session-data-redis:2.3.3.RELEASE
To Reproduce
We can not find the reproduce steps.
Expected behavior
No error
The text was updated successfully, but these errors were encountered: