-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Saving JDBC Session Attributes is not thread-safe #1216
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
Comments
Thanks for the report! NOTE: I don't think that |
Thanks for the report @bonhamcm. Actually this isn't a thread safety issue, as the same scenario can easily occur in a clustered setup, where concurrent requests are being load-balanced to different application instances. I'll try and reproduce this locally. |
I've found that this issue occurs when a user clicks one link and the accidentally clicks it again within one second of the first one. |
Thanks for the follow-up @bonhamcm - if that's the case I believe it should be fairly easy to prevent such scenario by adding some JavaScript code that disables (either permanently or temporarily) the link/button after it was clicked. That being said, I'm going to close this one as duplicate of #1213 since that one was opened first (I mistakenly closed it as duplicate, but reopened it shortly after). Please track #1213 for future progress on this, and feel free to add additional feedback there. |
Duplicate of #1213 |
Spring Framework 5.0.9.RELEASE
Spring Boot 2.0.5.RELEASE
Spring Session 2.0.6.RELEASE
PostgreSQL 9.3.20
PostgreSQL JDBC Driver 42.2.5
I'm experiencing the same error described in #1213 but I am using Spring Session 2.0.6.RELEASE which has the fix for #1031 / #1151:
It appears that the
JdbcOperationsSessionRepository$JdbcSession.delta
HashMap
which is used to determine if the session attributes should be inserted or updated is not thread-safe, thereby causing this issue. Using aConcurrentHashMap
could be a simple fix for this issue.The text was updated successfully, but these errors were encountered: