spring-projects / spring-projects/spring-session
Spring session PRINCIPAL_NAME_INDEX_NAME is not getting cleaned up after session is expired
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 55
Description
Describe the bug
"mysession:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:user" not cleaned up in redis when the session is expired
recently we were facing similar issue in the production, the uncleaned entries were huge and seeing some performance issue
could you please help to resolve this
To Reproduce
https://github.com/chittim412/demo.git --> checkout master
read readme file
libraries
spring boot 2.7.18
spring-session-data-redis:2.7.4
lettuce-core:6.1.10.RELEASE
redis running on docker
java 11
due to some internal issue we dont want to upgrade the system to spring boot 3 and java17
Expected behavior
"mysession:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:user" key should cleaned up in redis when the session is expired
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 linked demo repository and its README, using Spring Boot 2.7.18, Spring Session Data Redis 2.7.4, Lettuce 6.1.10.RELEASE, Java 11, and Redis in Docker. Reproduce session expiration and inspect cleanup of the PRINCIPAL_NAME_INDEX_NAME key; done means the user index key is removed after the session expires without leaving accumulating entries.
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
- 42/100