Describe the bug A short description of the bug. In Redis Pub/Sub, the client subscribes with [SUBSCRIBE ch-food ch-sports] command, If it publish the PUBLISH ch-food "chicken" message, subscribers correctly receive the "chicken" message.
Here, if [UNSUBSCRIBE ch-food] command is used to cancel the ch-food subscription, the output is as follows. 3) (integer) 0 <-- The returned value should be 1 instead of 0, which is considered a bug or error.
1) "unsubscribe" 2) "ch-food" 3) (integer) 0
You can see that the [ 3) (integer) 0 ] line cannot unsubscribe. Still, publish ch-food "chicken", subscribers receive it.
To reproduce Steps to reproduce the behavior and/or a minimal code sample.
[client-1] 127.0.0.1:9379> PUBLISH ch-food "chicken" (integer) 3 127.0.0.1:9379> UNSUBSCRIBE ch-food 1) "unsubscribe" 2) "ch-food" 3) (integer) 0 127.0.0.1:9379> PUNSUBSCRIBE ch-fo 1) "punsubscribe" 2) "ch-fo" 3) (integer) 0 127.0.0.1:9379> PUBLISH ch-food "chicken" (integer) 3
[client-2] 127.0.0.1:9379> SUBSCRIBE ch-food ch-sports Reading messages... (press Ctrl-C to quit) 1) "subscribe" 2) "ch-food" 3) (integer) 1 1) "subscribe" 2) "ch-sports" 3) (integer) 2 1) "message" 2) "ch-food" 3) "chicken" 1) "message" 2) "ch-food" 3) "chicken"
[client-3] 127.0.0.1:9379> PSUBSCRIBE ch-fo Reading messages... (press Ctrl-C to quit) 1) "psubscribe" 2) "ch-fo" 3) (integer) 1 1) "pmessage" 2) "ch-fo" 3) "ch-food" 4) "chicken" 1) "pmessage" 2) "ch-fo" 3) "ch-food" 4) "chicken"
Expected behavior A description of what you expected to happen. After the UNSUBSCRIBE ch-food and PUNSUBSCRIBE ch-fo* commands, client are still received and listening on that channel.
Additional information Any additional information that is relevant to the problem. Included in the above mentioned.
Comment From: Virusuki
Describe the bug A short description of the bug. In Redis Pub/Sub, the client subscribes with [SUBSCRIBE ch-food ch-sports] command, If it publish the PUBLISH ch-food "chicken" message, subscribers correctly receive the "chicken" message.
Here, if [UNSUBSCRIBE ch-food] command is used to cancel the ch-food subscription, the output is as follows.
3) (integer) 0 <-- The returned value should be 1 instead of 0, which is considered a bug or error. 1. "unsubscribe" 2. "ch-food" 3. (integer) 0
You can see that the [ 3) (integer) 0 ] line cannot unsubscribe. Still, publish ch-food "chicken", subscribers receive it.
To reproduce Steps to reproduce the behavior and/or a minimal code sample.
[client-1] 127.0.0.1:9379> PUBLISH ch-food "chicken" (integer) 3 127.0.0.1:9379> UNSUBSCRIBE ch-food
- "unsubscribe"
- "ch-food"
- (integer) 0 127.0.0.1:9379> PUNSUBSCRIBE ch-fo*
- "punsubscribe"
- "ch-fo*"
- (integer) 0 127.0.0.1:9379> PUBLISH ch-food "chicken" (integer) 3
[client-2] 127.0.0.1:9379> SUBSCRIBE ch-food ch-sports Reading messages... (press Ctrl-C to quit)
- "subscribe"
- "ch-food"
- (integer) 1
- "subscribe"
- "ch-sports"
- (integer) 2
- "message"
- "ch-food"
- "chicken"
- "message"
- "ch-food"
- "chicken"
[client-3] 127.0.0.1:9379> PSUBSCRIBE ch-fo* Reading messages... (press Ctrl-C to quit)
- "psubscribe"
- "ch-fo*"
- (integer) 1
- "pmessage"
- "ch-fo*"
- "ch-food"
- "chicken"
- "pmessage"
- "ch-fo*"
- "ch-food"
- "chicken"
Expected behavior A description of what you expected to happen. After the UNSUBSCRIBE ch-food and PUNSUBSCRIBE ch-fo* commands, client are still received and listening on that channel.
Additional information Any additional information that is relevant to the problem. Included in the above mentioned.