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

Allow sending commands after sending an unsubscribe #1034

Closed
wants to merge 2 commits into from

Conversation

bjosv
Copy link
Contributor

@bjosv bjosv commented Dec 28, 2021

Instead of handling reply callbacks in two modes or states ("normal" state and "subscribed" state)
we now use a common holder for non-subscribe callbacks.
This fixes the current issue of putting the callback in the wrong holder when going from "subscribed" state to "regular" state.

Added a test to trigger the fault.

Fixes #968 (last part)

Verify that commands are handled after unsubscribing from a channel.
A command is sent before the `unsubscribe` response is received,
which currently triggers an assert in async.c:567:

`redisProcessCallbacks: Assertion `(c->flags & REDIS_SUBSCRIBED || c->flags & REDIS_MONITORING)' failed.`
Re-order to first check if a received reply is a pushed subscription
message to be handled by a subscription callback.

This enables handling of commands after sending an unsubscribe.
@bjosv
Copy link
Contributor Author

bjosv commented Dec 29, 2021

Found some issues with this solution, so I'm withdrawing this PR until fixed.
The testcase is still valid though.

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.

Incorrect handling of commands in pub/sub state with RESP3
1 participant