spring-projects / spring-projects/spring-session
Session + redis -> Lost data when run many requests
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 55
Description
After migration to spring parent 2.5.0 from 3.4.0, the spring data redis lost data the intermittently.
I isolated one specific scenario that reproduce in my machine.
Enviroment:
- I use the default Spring integration
- I save the object complex in spring session through below code:
- I use the last version of redis (7.4.1)
Scenario
My aplication execute the endpoint /front/adapters/grouper/23866860
After the response of backend, the front call the requests in parallel
- /front/constraints/list/disabled
- /front/user-requirements/user/forced/dto
- /front/tree
- /front/user-requirements/recommendation/disabled
- /front/tree/nodes/filter/autocomplete
In my secondary user interactive, i call the endpoint /front/drawings-urs[]
My problem:
When, i started the application in every firsty execution, the system lost data session in the parallel requests.
I created one LoggableDispatcherServlet to log session informations, please follow the file:
LoggableDispatcherServlet.txt
In log from LoggableDispatcherServlet, please, check the order of request/response. I converted from table the better visualization
| event | type | - | endpoint | |
|---|---|---|---|---|
| 1 | IN | - | /front/adapters/grouper/23866860-urs[] | |
| 2 | OUT | - | /front/adapters/grouper/23866860-urs[{"id"100,"keyUr":"Project.motor.hasBrake"}] | |
| 3 | IN | - | /front/constraints/list/disabled-urs[] | |
| 4 | IN | - | /front/user-requirements/user/forced/dto-urs[] | |
| 5 | IN | - | /front/tree-urs[] | |
| 6 | IN | - | /front/user-requirements/recommendation/disabled-urs[] | |
| 7 | IN | - | /front/tree/nodes/filter/autocomplete-urs[] | |
| 8 | OUT | - | /front/constraints/list/disabled-urs[] | |
| 9 | OUT | - | /front/user-requirements/user/forced/dto-urs[] | |
| 10 | OUT | - | /front/user-requirements/recommendation/disabled-urs[] | |
| 11 | OUT | - | /front/tree-urs[] | |
| 12 | IN | - | /front/projects/status/allStatus-urs[{"id"100,"keyUr":"Project.motor.hasBrake"}] | |
| 13 | OUT | - | /front/projects/status/allStatus-urs[{"id"100,"keyUr":"Project.motor.hasBrake"}] | |
| 14 | OUT | - | /front/tree/nodes/filter/autocomplete-urs[] | |
| 15 | IN | - | /front/drawings-urs[] |
Check:
- In the line 1, the user call the execution endpoint /front/adapters/grouper/23866860 and not have data in session.
- in the line 2, the system filled data in session ({"id"100,"keyUr":"Project.motor.hasBrake"})
- Lines 3,4,5,6,7 automatic called data from backand, after the response of line 2 and not have the session data in the start.
- Line 12 and 13 have session spring data
- line 15, the next interaction to user, the data was lost.
Please, verify and fix this problem, please. If need more information, please tell me in the response this question.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached LoggableDispatcherServlet.txt and reproduce the listed endpoint sequence after the Spring parent migration, using Redis 7.4.1 and parallel requests. Compare session state across the logged request and response order, then verify that the session data remains available to the subsequent interaction and add regression coverage for the reproduced loss.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, redis, spring
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100