-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
process hangs due to default socket_timeout=None #2243
Comments
2 tasks
Also interested in seeing a fix for this applied. |
6 tasks
This issue is marked stale. It will be closed in 30 days if it is not updated. |
please unstale |
This issue is marked stale. It will be closed in 30 days if it is not updated. |
please unstale |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version: master (https://github.com/redis/redis-py/tree/bea72995fd39b01e2f0a1682b16b6c7690933f36)
Platform: Python 3.10 on Ubuntu 20.04
Description:
There is no default socket_timeout set for connections, which could lead to outages. (only tested
RedisCluster
, but the connection object seems to be shared with the single-node implementation)steps to reproduce
iptables
DROP rule, ordocker network disconnect NETWORK_ID CONTAINER_ID
(stopping/killing the container does NOT work, as the host might immediately generate ano route to host
response)expected behaviour
redis-py throws a timeout
actual behaviour:
the process hangs
relevant Stack trace (gdb)
The stack trace shows
socket_timeout=None
suggested fixes
BRPOP
/BLPOP
-> increase the socket timeout dynamically if those are used?)additional info
https://docs.python.org/3/library/socket.html#socket.socket.settimeout
(There is a related issue (#722) outlining some workarounds, I submitted this one to discuss changing the defaults to more sensible values)
The text was updated successfully, but these errors were encountered: