Skip to content

Clean Redis principal index during expiration cleanup#3798

Open
yeomin4242 wants to merge 1 commit into
spring-projects:mainfrom
yeomin4242:gh-1715-redis-principal-index-cleanup
Open

Clean Redis principal index during expiration cleanup#3798
yeomin4242 wants to merge 1 commit into
spring-projects:mainfrom
yeomin4242:gh-1715-redis-principal-index-cleanup

Conversation

@yeomin4242
Copy link
Copy Markdown

When Redis expiration events are unavailable, the expires key may be gone while the session hash remains available in the grace period. Clean the principal index during the existing expiration cleanup flow when that session is already expired.

Summary

  • clean stale Redis principal index entries from the existing Redis expiration cleanup flow
  • handle the case where sessions:expires:<sessionId> is already gone while the session hash is still available and expired
  • add a Redis static master/replica integration test that reproduces missing expiration events with RedisStaticMasterReplicaConfiguration

Addresses gh-1715.

Notes

This keeps the cleanup in RedisIndexedSessionRepository's expiration cleanup path. It does not change findByIndexNameAndIndexValue, so index lookups do not gain cleanup side effects.

The cleanup only removes the principal index entry when the session hash can still be loaded and the session is already expired. If the session hash is no longer available, this change leaves the index entry untouched.

This PR does not change SortedSetRedisSessionExpirationStore behavior.

When Redis expiration events are unavailable, the expires key may be gone while the session hash remains available in the grace period. Clean the principal index during the existing expiration cleanup flow when that session is already expired.

Addresses spring-projectsgh-1715.

Signed-off-by: YeongJae Min <whereismysejong@naver.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants