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

  1. "unsubscribe"
  2. "ch-food"
  3. (integer) 0 127.0.0.1:9379> PUNSUBSCRIBE ch-fo*
  4. "punsubscribe"
  5. "ch-fo*"
  6. (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
  4. "subscribe"
  5. "ch-sports"
  6. (integer) 2
  7. "message"
  8. "ch-food"
  9. "chicken"
  10. "message"
  11. "ch-food"
  12. "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
  4. "pmessage"
  5. "ch-fo*"
  6. "ch-food"
  7. "chicken"
  8. "pmessage"
  9. "ch-fo*"
  10. "ch-food"
  11. "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.