spring-projects / spring-projects/spring-session

Redis session has no expiration set on high load

Open
#3,357 0 comments 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

Describe the bug
Redis sessions with no expiration time are created even if the ReactiveRedisSessionRepository.setDefaultMaxInactiveInterval(Duration) is set. This happens when the app is high loaded

To Reproduce
Let's load the app using JMeter with 75 threads/users. Each request invokes the endpoint that creates a new session using session.changeSessionId(). About 10 minutes later we should notice that among sessions with ttl set, there is a few sessions with no ttl appear

Expected behavior
If ReactiveRedisSessionRepository.setDefaultMaxInactiveInterval(Duration) then all created sessions should have ttl set, even on high loads

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 ReactiveRedisSessionRepository.setDefaultMaxInactiveInterval(Duration) and reproduce the issue using JMeter with 75 threads/users, including requests that call session.changeSessionId(). Inspect Redis session TTLs after sustained load; done means every newly created session has the configured expiration, with no sessions lacking a TTL.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.