Skip to content

fix write race condition when slot migration #3361

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hengyoush
Copy link

@hengyoush hengyoush commented Jul 17, 2025

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

This PR fixes the issue where during slot migration(#3353 ), there might be concurrent writes of other commands between the asking command and the actual command. It achieves this by modifying the writeToChannelAndFlush(Channel channel, Collection<? extends RedisCommand> commands), changing the original method of writing to the channel using a for loop to directly writing the list to the channel, thus avoiding the aforementioned issue.

Signed-off-by: hengyouhai <hengyouhai@tuhu.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant