Task was destroyed but it is pending! (Python, Asyncio, Quart)

60 views Asked by At

The error message is telling that a task was destroyed, but it's still pending. Specifically, we have a task with the name 'Task-1672902' that was in the middle of running the handle_messages() function at /usr/local/lib/python3.8/site-packages/quart/asgi.py:56. But for some reason, it got destroyed before it could complete.

handle_messages function: https://github.com/pallets/quart/blob/140bdc18d4b8a331f2b7523fd4782e47780acff2/src/quart/asgi.py#L175

The message: Task was destroyed but it is pending! task: <Task pending name='Task-1672902' coro=<ASGIHTTPConnection.handle_messages() running at /usr/local/lib/python3.8/site-packages/quart/asgi.py:56> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7feb66ff0190>()]>>

Environment:

Python version: 3.8.12 Quart version: 0.19.3

I can't trace the issue for more details nor replicating it.

0

There are 0 answers