Task was destroyed but it is pending!
See original GitHub issueI’m running a pretty simple quart app with hypercorn on a RHEL7 linux server. quart = 0.10.0 hypercorn = 0.9.0
I keep seeing these messages printed to standard out randomly every couple requests.
Task was destroyed but it is pending!
task: <Task pending coro=<ProtocolWrapper.send_task() done, defined at /root/.local/share/virtualenvs/atomix-Zh2dG3yU/lib/python3.7/site-packages/hypercorn/protocol/__init__.py:58> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f08fc3db1d0>()]>>
Task was destroyed but it is pending!
task: <Task pending coro=<ProtocolWrapper.send_task() done, defined at /root/.local/share/virtualenvs/atomix-Zh2dG3yU/lib/python3.7/site-packages/hypercorn/protocol/__init__.py:58> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f08f55188d0>()]>>
I’m pretty sure it has to do with hypercorn because I don’t see the messages when I run the app using app.run(…). I’m having trouble narrowing down the problem anymore than that… Is anyone else seeing these messages?
Every once in a while I have a json request fail. The response body is mysteriously empty. The content-length is set to the correct non 0 value but nothing is in the body. I’m not sure if its related to this or not.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Please explain "Task was destroyed but it is pending!" after ...
The problem comes from closing the loop immediately after cancelling the tasks. As the cancel() docs state.
Read more >Task was destroyed but it is pending · Issue #1634 - GitHub
Problem with celery task, that aggregates media from some channels. Previously i tried "sync" version of TelethonClient and got same errors.
Read more >Task was destroyed but it is pending! - Questions and Help
I'm having a hard time trying to avoid the following issue: Task was destroyed but it is pending! This is related to the...
Read more >Common Mistakes Using Python3 asyncio
3 Task was destroyed but it is pending! The cause of this problem is that the EventLoop closed right after canceling pending tasks....
Read more >ERROR Task was destroyed but it is pending! - Google Groups
System check identified no issues (0 silenced). ... To quit the server, press Control+C. ... ERROR Task was destroyed but it is pending!...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, so I’m now confident that 0.9.3 has fixed this.
Well, that didn’t take long:
Started up the hypercorn server (running Quart), clicked around a few of the links in my web app, was working fine. Walked away from my computer and made myself coffee. Came back, clicked another link (same session, browser, window, etc.), instantly this. Note that the page still loaded fine (they really always do), but yet still getting that error in the log.
EDIT: Confirmed that this
dev
version does include 1e350e4. From/home/bhimes/Gits/hardware-tooling/venvhypercorn/lib/python3.8/site-packages/hypercorn/protocol/h2.py
These are all h2 in Chrome btw.