You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cleanupExpiredSessionsTask will never run again when exception ocurred in cleanUPExpiredSession method #3426
Describe the bug
In ReactiveRedisIndexedSessionRepository class, when cleanUpExpiredSession method has exception,like the following stacktrace,the interval task will terminated ,not run next time:
2025-06-20 15:35:18.138 [TID: N/A] [lettuce-eventExecutorLoop-3-1] ERROR reactor.core.publisher.Operators -Operator called default onErrorDropped org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out after 5 second(s) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:70) Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: Assembly trace from producer [reactor.core.publisher.MonoError] : reactor.core.publisher.MonoNext$NextSubscriber.onError(MonoNext.java:93) io.lettuce.core.RedisPublisher$ImmediateSubscriber.onError(RedisPublisher.java:891) Error has been observed at the following site(s): *__MonoNext$NextSubscriber.onError ⇢ at io.lettuce.core.RedisPublisher$ImmediateSubscriber.onError(RedisPublisher.java:891) *__________________Flux.onErrorMap ⇢ at org.springframework.data.redis.connection.lettuce.LettuceReactiveRedisConnection.execute(LettuceReactiveRedisConnection.java:224) |_ Flux.next ⇢ at org.springframework.data.redis.connection.ReactiveKeyCommands.exists(ReactiveKeyCommands.java:176) |_ Mono.map ⇢ at org.springframework.data.redis.connection.ReactiveKeyCommands.exists(ReactiveKeyCommands.java:176) *___________________Flux.usingWhen ⇢ at org.springframework.data.redis.core.ReactiveRedisTemplate.doInConnection(ReactiveRedisTemplate.java:242) |_ Mono.from ⇢ at org.springframework.data.redis.core.ReactiveRedisTemplate.doCreateMono(ReactiveRedisTemplate.java:220) |_ Mono.then ⇢ at org.springframework.session.data.redis.ReactiveRedisIndexedSessionRepository.touch(ReactiveRedisIndexedSessionRepository.java:336)
From the stack trace, the failure comes from the Redis call in
ReactiveRedisIndexedSessionRepository (touch), and the reactive cleanup
pipeline seems to terminate on the first error with no resubscription.
My plan:
Reproduce it with a unit test (first cleanup tick fails, second succeeds)
Handle errors per cleanup run so the job logs and keeps going
Keep cleanup disablement (Duration.ZERO / disableCleanupTask) working
Does this direction sound right? Happy to adjust based on feedback.
I've opened a pull request for this: #4205. It handles errors per cleanup run
with onErrorResume so a failed run is logged and the next scheduled run
continues. Feedback welcome.
Activity
theigl commentedon Oct 3, 2025
We just encountered the same issue. The cleanup job never runs again after an exception.
Keerthana7654 commentedon Dec 4, 2026
Hi! I'd like to work on this.
From the stack trace, the failure comes from the Redis call in
ReactiveRedisIndexedSessionRepository (touch), and the reactive cleanup
pipeline seems to terminate on the first error with no resubscription.
My plan:
Does this direction sound right? Happy to adjust based on feedback.
Keerthana7654 commentedon Dec 4, 2026
I've opened a pull request for this: #4205. It handles errors per cleanup run
with onErrorResume so a failed run is logged and the next scheduled run
continues. Feedback welcome.