Skip to content

Delay in consuming redis session expiration events #3141

Open
@KasmicSupes

Description

@KasmicSupes

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>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions