Skip to content

Indicate spin-wait in RedisMessageListenerContainer retries#3317

Merged
mp911de merged 1 commit intospring-projects:mainfrom
l2yujw:perf/redis-message-listener-spinwait
Feb 23, 2026
Merged

Indicate spin-wait in RedisMessageListenerContainer retries#3317
mp911de merged 1 commit intospring-projects:mainfrom
l2yujw:perf/redis-message-listener-spinwait

Conversation

@l2yujw
Copy link
Contributor

@l2yujw l2yujw commented Feb 22, 2026

Motivation

RedisMessageListenerContainer retries subscription/unsubscription in a tight loop as part of synchronization.
Adding Thread.onSpinWait() preserves the existing behavior while reducing CPU overhead during the spin.

Changes

  • Added Thread.onSpinWait() to the retry loops in lazyListen(…) and stopListening()

How to test

  • Run: ./mvnw test

Signed-off-by: l2yuPa <jeungwon28@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 22, 2026
@mp911de mp911de changed the title Reduce CPU spinning in RedisMessageListenerContainer Indicate spin-wait in RedisMessageListenerContainer retries Feb 23, 2026
@mp911de mp911de self-assigned this Feb 23, 2026
@mp911de mp911de added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 23, 2026
@mp911de mp911de added this to the 4.0.4 (2025.1.4) milestone Feb 23, 2026
@mp911de mp911de merged commit 15572e2 into spring-projects:main Feb 23, 2026
7 checks passed
mp911de pushed a commit that referenced this pull request Feb 23, 2026
Signed-off-by: l2yuPa <jeungwon28@gmail.com>
Closes #3317
@mp911de
Copy link
Member

mp911de commented Feb 23, 2026

Thank you for your contribution. That's merged and backported now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants