Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

PubSub hangs on disconnect #354

Closed
dfee opened this issue Dec 12, 2017 · 5 comments
Closed

PubSub hangs on disconnect #354

dfee opened this issue Dec 12, 2017 · 5 comments
Assignees
Labels
Milestone

Comments

@dfee
Copy link

dfee commented Dec 12, 2017

It seems I can manually close a subscription in Redis CLIENT KILL ID xyz, and mpsc.get() will continue to hang. https://github.com/aio-libs/aioredis/blob/master/aioredis/pubsub.py#L259

This seems like a bug. Is there some way I should be manually checking (on a timeout) if we're still in pubsub mode?

I.e.

while True:
    result = await asyncio.gather(asyncio.sleep(1), mpsc.wait_message())
    if result[0]:
        if not pool.connection.in_pubsub:
            break
    if result[1]:
        yield await mpsc.get()
@popravich
Copy link
Contributor

The fix is in master, please try it.

@gjcarneiro
Copy link

I'm testing aioredis master, this seem to work very well, good job!

@popravich popravich added this to the v1.1 milestone Feb 16, 2018
@gjcarneiro
Copy link

When can we expect a release? I'm currently running in production with revision e706ea3 from git, because of this bug.

On one hand, great, I had another incident last night with my service losing connection to the redis server (some kind of network glitch), and it recovered correctly from that. But I would rather be using a proper release, than git...

@popravich
Copy link
Contributor

aioredis v1.1 already released

@gjcarneiro
Copy link

Yes, thanks! Silly of me for not checking... 🤦‍♂️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants