Skip to content

Delay in processing spring expiration events #3396

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 May 16, 2025 · 0 comments
Open

Delay in processing spring expiration events #3396

KasmicSupes opened this issue May 16, 2025 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged type: bug A general bug

Comments

@KasmicSupes
Copy link

Describe the bug
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>

To Reproduce
Kill around 3k sessions at a single point of time

Expected behavior
Every session should be cleared, but few sessions are getting cleared in huge delay

@KasmicSupes KasmicSupes added type: bug A general bug status: waiting-for-triage An issue we've not yet triaged labels May 16, 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 type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant