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

Timeout Error 110, Can reconnections be handled gracefully? #1398

Open
1 task done
paulBlackburn opened this issue Jul 28, 2022 · 0 comments
Open
1 task done

Timeout Error 110, Can reconnections be handled gracefully? #1398

paulBlackburn opened this issue Jul 28, 2022 · 0 comments
Labels

Comments

@paulBlackburn
Copy link

Describe the bug

I'm using version 2.3.2 of channels-redis. I have an instance of Azure Cache for Redis. A few times a year, failovers occur. From Azure "A failover occurs when a primary node in the cache is taken offline for routine maintenance, and a replica node is promoted to replace it". When this happens, I have to restart the Django server and restart daphne. Is there any way for aioredis to gracefully handle these timeouts. When these timeouts occur no new connections can be made until I restart. The stack trace below is from await self.channel_layer.group_send. Any suggestions?

python3.6 daphne -b 127.0.0.1 -p 9000 asgi:application
python3.6 gunicorn wsgi:application -c gunicorn.conf.py

To Reproduce

I can't recreate this issue because it is dependent on azure performing routine maintenance.

Expected behavior

Gracefully handle timeout. New websocket connections should be able to be established.

Logs/tracebacks

File "/home/ubuntu/.virtualenvs/venv/lib/python3.6/site-packages/channels_redis/core.py", line 611, in group_send
key, min=0, max=int(time.time()) - self.group_expiry
File "/home/ubuntu/.virtualenvs/venv/lib/python3.6/site-packages/aioredis/connection.py", line 186, in _read_data
obj = await self._reader.readobj()
File "/home/ubuntu/.virtualenvs/venv/lib/python3.6/site-packages/aioredis/stream.py", line 102, in readobj
await self._wait_for_data('readobj')
File "/usr/lib/python3.6/asyncio/streams.py", line 464, in _wait_for_data
yield from self._waiter
File "/usr/lib/python3.6/asyncio/selector_events.py", line 714, in _read_ready
data = self._sock.recv(self.max_size)
TimeoutError: [Errno 110] Connection timed out

Python Version

3.6.8

aioredis Version

1.3.1

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct
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

1 participant