Skip to content

Delay in consuming redis session expiration events #3141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
KasmicSupes opened this issue Apr 29, 2025 · 0 comments
Open

Delay in consuming redis session expiration events #3141

KasmicSupes opened this issue Apr 29, 2025 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@KasmicSupes
Copy link

KasmicSupes commented Apr 29, 2025

Im running into a weird problem. I have the spring session redis thread executor as below
@Bean(name = "springSessionRedisTaskExecutor") public TaskExecutor springSessionRedisTaskExecutor() { ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor(); taskExecutor.setThreadNamePrefix("someuniquename"); taskExecutor.setMaxPoolSize(10); taskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy()); return taskExecutor; }

I can see in my application logs that there are frequent error logs with message
Unable to publish SessionDestroyedEvent for session someid

To debug I took the minutebased cronjob redis key and checked the session id's which are supposed to execute at the next minute. After that when I was verifying how many of those session's have been actually expired I found that from 600 around 30 session's haven't expired yet (i.e didnt get the event as we have one more method based on this session destroyed event). And what is more weird is that Im getting that Unable to publish SessionDestroyedEvent log message for these sessions at a later point of time anywhere between few hours to few days. To check if redis is delaying from sending expired event I connected to the expired channel to check if all expired events for the session ids are being pushed. That is working correctly however there seems to be some unexpected lag when consuming these events at spring side. I'm not able to figure out the problem, can someone provide me pointers on what to check or has anyone else faced the same issue>

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 29, 2025
@KasmicSupes KasmicSupes changed the title Delay in consuming spring expiration events Delay in consuming redis session expiration events Apr 29, 2025
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

No branches or pull requests

2 participants