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

got Future <Future pending> attached to a different loop #340

Closed
njuptfx opened this issue Nov 14, 2022 · 1 comment
Closed

got Future <Future pending> attached to a different loop #340

njuptfx opened this issue Nov 14, 2022 · 1 comment

Comments

@njuptfx
Copy link

njuptfx commented Nov 14, 2022

channels: 4.0.0
channels_redis: 4.0.0

The following error is encountered, when I create a ws connect.

[2022-11-14 17:58:24 +0800] [7] [INFO] ('172.18.0.11', 35474) - "WebSocket /ws/notification/1/?token=3685A4C0B1B8AC30C59B7C3DF93757B9000F1C08DA164AAF75022E749212F96EA341047468F95F9391017F05267C7CE96F20D9B1A6AF04071DCE8B5B9CF416D3" [accepted]
[2022-11-14 17:58:24 +0800] [7] [INFO] connection open
[2022-11-14 17:58:24 +0800] [7] [ERROR] [asyncio:118] Task exception was never retrieved
future: <Task finished name='Task-5280' coro=<Connection.disconnect() done, defined at /usr/local/lib/python3.11/site-packages/redis/asyncio/connection.py:819> exception=RuntimeError("Task <Task pending name='Task-5280' coro=<Connection.disconnect() running at /usr/local/lib/python3.11/site-packages/redis/asyncio/connection.py:831>> got Future attached to a different loop")>
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/redis/asyncio/connection.py", line 831, in disconnect
await self._writer.wait_closed() # type: ignore[union-attr]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/streams.py", line 350, in wait_closed
await self._protocol._get_close_waiter(self)
RuntimeError: Task <Task pending name='Task-5280' coro=<Connection.disconnect() running at /usr/local/lib/python3.11/site-packages/redis/asyncio/connection.py:831>> got Future attached to a different loop

And it works well on channels=3.0.5, channels-redis=3.4.1

@smithdc1
Copy link
Member

Thanks for the report. This looks to be a duplicate of #332, see comment

@njuptfx njuptfx closed this as completed Feb 3, 2023
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