card323 / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

"punsubscribe *" does not unsubscribe from channel "foo" #529

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What version of Redis you are using, in what kind of Operating System?
I have tested this on 2.2.4 and master as of the date of submission.  I'm using 
Mac OS 10.6.

What is the problem you are experiencing?
Running the command "punsubscribe *" does not unsubscribe from all the channels 
that the proc is subscribed to.  My expectation, perhaps wrongly, is that 
"punsubscribe *" should unsubscribe me from all the channels I am subscribed 
to, and thus be more or less equivalent to unsubscribe.
However, even if that semantic is wrong, I still expect "punsubscribe f*" to 
unsubscribe me from channel "foo", but this does not appear to be happening 
either.

What steps will reproduce the problem?
It is hard to reproduce this, because redis-cli doesn't seem to support 
unsubscribing.  Therefore, I have written up a small c program using hiredis 
that recreates the problem.  It is attached, and also available as a gist: 
https://gist.github.com/927538 .  I am not a great *nix C coder, so my 
apologies if there are any atrocities against good taste in there.

Do you have an INFO output? Please past it here.
Here is the info when I am running on master:
# Server
redis_version:2.3.0
redis_git_sha1:b8513c93
redis_git_dirty:0
arch_bits:64
multiplexing_api:kqueue
process_id:38002
tcp_port:6379
uptime_in_seconds:651
uptime_in_days:0
lru_clock:298474

# Clients
connected_clients:1
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0

# Memory
used_memory:931392
used_memory_human:909.16K
used_memory_rss:1146880
mem_fragmentation_ratio:1.23
use_tcmalloc:0

# Persistence
loading:0
aof_enabled:0
changes_since_last_save:0
bgsave_in_progress:0
last_save_time:1303218329
bgrewriteaof_in_progress:0

# Diskstore
ds_enabled:0

# Stats
total_connections_received:18
total_commands_processed:33
expired_keys:0
evicted_keys:0
keyspace_hits:0
keyspace_misses:0
pubsub_channels:0
pubsub_patterns:0

# Replication
role:master
connected_slaves:0

# CPU
used_cpu_sys:0.10
used_cpu_user:0.08
used_cpu_sys_childrens:0.00
used_cpu_user_childrens:0.00

# Keyspace

If it is a crash, can you please paste the stack trace that you can find in
the log file or on standard output? This is really useful for us!
N/A
Please provide any additional information below.
N/A

Original issue reported on code.google.com by yeoldefo...@gmail.com on 19 Apr 2011 at 1:22

Attachments:

GoogleCodeExporter commented 8 years ago
Hello, wrong expectation I believe ;) You can subscribe to a pattern, and 
unsubscribe to a pattern.
The pattern will be used to match against messages sent to specific channels, 
not to match channels already existing to subscribe/unsubscribe to those 
channels.

Regards,
Salvatore

Original comment by anti...@gmail.com on 19 Apr 2011 at 2:19