spring-projects / spring-projects/spring-session

Session + redis -> Lost data when run many requests

Open
#3,285 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: bug
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:

  1. I use the default Spring integration
  2. I save the object complex in spring session through below code:
image
  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.