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
SessionRepositoryFilter.SessionRepositoryRequestWrapper.commitSession() triggers extraneous call to SessionRespository.findById(...) #1731
Comments
Add workaround for spring-projects/spring-session#1731
Upgrade spring-session to 2.4.1. Add workaround for spring-projects/spring-session#1731
…epositoryRequestWrapper.commitSession() due to premature cache clearing. Closes spring-projectsgh-1731
…epositoryRequestWrapper.commitSession() due to premature cache clearing. Closes spring-projectsgh-1731
Hi All can i know in which release above fix will be available as i am facing the same issue mentioned above |
Spring Session works great for session management but noticed lot of slowness because of this known issue. This is very urgent issue and blocker. Is there any official release date for this? |
All this is a significant impact to performance for spring with apps that are using session management, Any chance we will see this fix pushed to the master branch in the next week or so. Thanks in advance. |
This issue impacts the performance for large JSPs which has jsp:include where it tries to commit on each include but due to session getting cleared and call to getRequestedSessionId makes getSessionQuery again. |
Describe the bug
For a valid session, SessionRepositoryFilter.SessionRepositoryRequestWrapper.commitSession() does the following:
However, since #1 already cleared the requested session cached values #3 requires a completely redundant call to SessionRepository.findById(...). Depending on the implementation, this can be unnecessarily expensive.
To Reproduce
Use a tracer to detect calls to SessionRepository.findById(...). For a requested session, this is triggered twice, once at the beginning of the request, and again after the session is saved.
Expected behavior
SessionRepository.findById(...) should be considered a potentially expensive operation, and only triggered when necessary. Clearing cached values after determining whether to send the session ID to the client (i.e. in a finally block) would solve the problem.
The text was updated successfully, but these errors were encountered: