debasishg / scala-redis

A scala library for connecting to a redis server, or a cluster of redis nodes using consistent hashing on the client side.
1.02k stars 219 forks source link

Unset pubsub flag on unsubscribe #207

Closed debasishg closed 6 years ago

debasishg commented 6 years ago

Fixes problem reported in https://github.com/debasishg/scala-redis/issues/109#issuecomment-386718317.

Added an additional test case in RedisClientSpec.

billoneil commented 6 years ago

This actually looks similar to the issue I listed here. https://github.com/debasishg/scala-redis/issues/109#issuecomment-193850786

If you don't consume the buffer from the response the connection can be in a bad state.

Try calling send("UNSUBSCRIBE")(asString) as well, but you still need to force it to evaluate the string or it won't flush the buffer. I could be wrong and haven't had a Scala environment in some time so I can't verify.