Repository navigation
Conversation
Previously, when no springSessionRedisTaskExecutor bean was defined, RedisMessageListenerContainer fell back to SimpleAsyncTaskExecutor, which creates a new thread for every Redis message. Now the container created by RedisIndexedHttpSessionConfiguration dispatches messages with a ThreadPoolTaskExecutor of 10 threads by default. The container manages that pool and shuts it down when it is destroyed. When neither executor bean is defined, the subscription runs on its own SimpleAsyncTaskExecutor so that it does not hold one of the dispatch threads. User-defined executors are used as before. Closes spring-projectsgh-485 Signed-off-by: vipul080 <118840789+vipul080@users.noreply.github.com>
vipul080
marked this pull request as ready for review
November 21, 2026 04:01
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes gh-485
When no
springSessionRedisTaskExecutorbean is defined, theRedisMessageListenerContainercreated byRedisIndexedHttpSessionConfigurationfalls back toSimpleAsyncTaskExecutor, which starts a new thread for every Redis message.Changes
createDefaultTaskExecutor()to return aThreadPoolTaskExecutor(10 core threads, core thread timeout enabled, thread name prefixspring-session-redis-). Because the container creates this executor itself, it also shuts it down indestroy().springSessionRedisTaskExecutornorspringSessionRedisSubscriptionExecutoris defined, the subscription runs on its ownSimpleAsyncTaskExecutor(prefixspring-session-redis-subscription-). Otherwise Spring Data Redis would reuse the dispatch pool for the subscription, and with a blocking connection factory it would hold one of the pool's threads.springSessionRedisTaskExecutoris defined, it is still used for both dispatch and subscription.TaskExecutor" section of the reference docs.Tests
Added tests to
RedisIndexedHttpSessionConfigurationTestsfor:./gradlew :spring-session-data-redis:checkand:spring-session-data-redis:integrationTestpass locally.Open questions
mainbecause this changes default behavior. Let me know if it should go to a maintenance branch instead.