Skip to content
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

asyncio.exceptions.CancelledError on shutdown of aiohttp deployment. #750

Closed
shasan-beanfield opened this issue Jul 12, 2021 · 2 comments
Closed

Comments

@shasan-beanfield
Copy link

shasan-beanfield commented Jul 12, 2021

Describe the bug
I get pretty consistent printout of the folowing traceback every time there is a server restart. This should have been handled in asyncio_redis_manager.py as an additional exception which simply stops listening (by terminating the infinite loop there). Unless there is a different graceful shutdown pathway I'm not considering.

To Reproduce
Steps to reproduce the behavior:

  1. Setup python-socketio with aiohttp deployment strategy
  2. run server
  3. stop server

Expected behavior
I wouldn't expect this to be thrown as an issue at all. We know the server is shutting down, and ultimately cancelling all asyncio tasks related to the current loop.

Logs
Traceback (most recent call last):
File ".venv/lib/python3.8/site-packages/socketio/asyncio_pubsub_manager.py", line 152, in _thread
message = await self._listen()
File ".venv/lib/python3.8/site-packages/socketio/asyncio_redis_manager.py", line 98, in _listen
return await self.ch.get()
File ".venv/lib/python3.8/site-packages/aioredis/pubsub.py", line 73, in get
msg = await self._queue.get()
File ".venv/lib/python3.8/site-packages/aioredis/pubsub.py", line 416, in get
await self.wait()
File ".venv/lib/python3.8/site-packages/aioredis/pubsub.py", line 412, in wait
await self._event.wait()
File "/usr/lib/python3.8/asyncio/locks.py", line 309, in wait
await fut
asyncio.exceptions.CancelledError

Additional context
Add any other context about the problem here.

@miguelgrinberg
Copy link
Owner

Thanks. Can I ask you to install python-socketio from the main branch and confirm the bug is fixed?

@shasan-beanfield
Copy link
Author

Hi, Our app is not yet compatible with this version of socket.io I will update this ticket once it is.

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

No branches or pull requests

2 participants