spring-projects / spring-projects/spring-session

Spring session PRINCIPAL_NAME_INDEX_NAME is not getting cleaned up after session is expired

Open
#3,287 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

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
image

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.