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

Handle array response during subscribe in RESP3 #1014

Merged
merged 1 commit into from
Dec 22, 2021

Conversation

bjosv
Copy link
Contributor

@bjosv bjosv commented Nov 1, 2021

RESP3 allows sending commands in parallell with pubsub handling and these commands might get responded with a REDIS_REPLY_ARRAY, like SORT. This conflicts with the pubsub response handling for RESP2, and triggers asserts when attempting to find the subscribe callback.

This PR adds functionality to keep track of PUSH support (RESP3) on the connection to know when replies are subscribe replies.

@bjosv bjosv force-pushed the array-during-subscribe-resp3 branch from 7e8c3f9 to af3f432 Compare November 25, 2021 07:15
@bjosv
Copy link
Contributor Author

bjosv commented Nov 25, 2021

This will be accompanied with a test when/if #1012 is merged. That testcase will be modified by adding a call to TIME which returns an array.
PR is updated to use the already delivered testcase.

@bjosv bjosv force-pushed the array-during-subscribe-resp3 branch from af3f432 to 7b34aab Compare December 2, 2021 18:22
@bjosv bjosv marked this pull request as ready for review December 2, 2021 18:39
@bjosv bjosv force-pushed the array-during-subscribe-resp3 branch from 7b34aab to 49d9824 Compare December 3, 2021 10:15
Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

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

LGTM

async.c Outdated Show resolved Hide resolved
RESP3 allows sending commands in parallell with pubsub handling
and these commands might get responded with a REDIS_REPLY_ARRAY.
This conflicts with the pubsub response handling for RESP2 and
results in a faulty state when using RESP3.

Add functionality to keep track of PUSH/RESP3 support on the connection
and only expect the message type REDIS_REPLY_PUSH as subscribe messages
when once seen.
@bjosv bjosv force-pushed the array-during-subscribe-resp3 branch from 9b0c433 to 526ef2d Compare December 17, 2021 10:41
@michael-grunder michael-grunder merged commit 58aacda into redis:master Dec 22, 2021
@michael-grunder
Copy link
Collaborator

Merged, thanks again!

@bjosv bjosv deleted the array-during-subscribe-resp3 branch December 22, 2021 19:27
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.

3 participants