Skip to content
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

Fix cannot publish when subscribed with RESP3 #2778

Closed
wants to merge 1 commit into from

Conversation

dengliming
Copy link
Collaborator

@dengliming dengliming commented Mar 11, 2024

closes #2594

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 use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

@mp911de mp911de added this to the 6.3.2.RELEASE milestone Mar 13, 2024
@mp911de mp911de added the type: bug A general bug label Mar 13, 2024
@mp911de
Copy link
Collaborator

mp911de commented Mar 13, 2024

Thanks a lot, Pub/Sub tests require an update. I'm going to take care of this during the merge.

@mp911de mp911de self-assigned this Mar 13, 2024
private static boolean isAllowed(RedisCommand<?, ?, ?> command) {
return ALLOWED_COMMANDS_SUBSCRIBED.contains(command.getType().name());
private boolean isAllowed(RedisCommand<?, ?, ?> command) {
return getProtocolVersion() == ProtocolVersion.RESP3 || ALLOWED_COMMANDS_SUBSCRIBED.contains(command.getType().name());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also make sense to check against the negotiated version instead of the configured one as the default is to auto-detect the protocol version while ClientOptions.getProtocolVersion() returns ProtocolVersion.newestSupported() (RESP3). This can lead to auto-negotiation into RESP2 while ClientOptions.getProtocolVersion() would return RESP3.

mp911de pushed a commit that referenced this pull request Mar 13, 2024
mp911de added a commit that referenced this pull request Mar 13, 2024
Update tests to reflect new behavior. Use negotiated protocol version and fall back to the configured one of no negotiated version is available.

Original pull request: #2778
mp911de pushed a commit that referenced this pull request Mar 13, 2024
mp911de added a commit that referenced this pull request Mar 13, 2024
Update tests to reflect new behavior. Use negotiated protocol version and fall back to the configured one of no negotiated version is available.

Original pull request: #2778
@mp911de
Copy link
Collaborator

mp911de commented Mar 13, 2024

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

@mp911de mp911de closed this Mar 13, 2024
@dengliming dengliming deleted the fix_publish_0311 branch March 14, 2024 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't PUBLISH when subscribed with RESP3
2 participants