Skip to content

py-redis don't acknowledged disconnection from the server #3547

@adilbenameur

Description

@adilbenameur

Hi,
I have a redis server hosted on Azure (Azure Redis PaaS). From time to time, I have connection error to this server with py-redis. From the network capture I have made with tcpdump, py-redis don't seems to respond to the server asking to drop the connection. It only respond to keepalive packets sent by the server. Finnnaly, the connection is dropped by the server with RST packet. I think the socket is broken on py-redis side but still stays in the connection pool. And when py-redis try to reuse it, an error redis.exceptions.ConnectionError is thrown because the socket is broken.

Until commit acac4db, I think py-redis used selector to handle network events. But since then, I don't think their is something in the code to handle network events like disconnection.

Issue is related to #3509.

Image

For now, I think I can use retry_on_error to reconnect after ConnectionError but might be worth to implement a real fix.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions