spring-projects / spring-session

Spring Session

Home Page:https://spring.io/projects/spring-session

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider Sorted Set Expiration Policy in RedisIndexedHttpSession

marcusdacoregio opened this issue · comments

Similar to https://docs.spring.io/spring-session/reference/3.3/configuration/reactive-redis-indexed.html#how-spring-session-cleans-up-expired-sessions

Currently, if the server is down for some time, the sessions might not be visited to force its expiration.
That happens because the key that holds the information about when the sessions will expire is based on the expected expiration minute, however, if the server is down during the time of that key, some of them might be skipped, resulting in memory usage overhead.

That problem also happens when using a clustered Redis: since Spring Data Redis only subscribes to events from a single node, events emitted by other nodes are not received, therefore some indexed sessions are not cleaned up.