Skip to content

[BUG] redis-cli doesn't auto exit from subscribed mode on reaching zero subscription #12592

@hpatro

Description

@hpatro

Describe the bug

redis-cli continue to be in pubsub/subscribed mode even if the server has unsubscribed the client for a given channel. This applies for both classic and sharded pubsub.

To reproduce

127.0.0.1:6379(subscribed mode)> SUBSCRIBE ch1
1) "subscribe"
2) "ch1"
3) (integer) 1
127.0.0.1:6379(subscribed mode)> unsubscribe ch1
1) "unsubscribe"
2) "ch1"
3) (integer) 0
127.0.0.1:6379(subscribed mode)>

Expected behavior

redis-cli should exit the subscribed mode

Additional information

Discussed in #12577

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions