Skip to content

Prevent most Redis commands when subscribed to PubSub channel #219

@414owen

Description

@414owen

I spent a long time tracking down a heisenbug recently, that I'm fairly confident comes down to the fact that you're not allowed to use most redis commands if you're subscribed to a pub/sub channel.

The docs say:

Once the client enters the subscribed state it is not supposed to issue any other commands, except for additional SUBSCRIBE, SSUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE, SUNSUBSCRIBE, PUNSUBSCRIBE, PING, RESET and QUIT commands. However, if RESP3 is used (see HELLO) it is possible for a client to issue any commands while in subscribed state.

Even if it didn't cause my specific bug, I think that it would be great for hedis to prevent this misuse of redis, preferably in the type system.

This limitation no longer applies to RESP3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions