Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Connection needs to be disconnected when remote redis exit unexpectedly #65

Open
gleery opened this issue Jun 4, 2014 · 0 comments
Open

Comments

@gleery
Copy link

gleery commented Jun 4, 2014

When remote redis goes down, client will receive a on_disconnect event, and throw a
ConnectionError("Socket closed on remote end")

but when redis goes up, and we try to redo our previous actions, we will be blocked at
client.py 1290: yield gen.Task(self.connection.wait_until_ready)
the callback will never be called, hence we can't automatically recover from failure cases.

I fix this issue by add two lines(321,322)
318 def on_disconnect(self):
319 if self.subscribed:
320 self.subscribed = set()
321 if self.connection:
322 self.connection.disconnect()
323 raise ConnectionError("Socket closed on remote end")

When we are disconnected from remote server, we need to disconnect locally, so we won't be blocked for the previous failed unfinished request.

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

No branches or pull requests

1 participant