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
tornado.queues consumers are difficult to stop cleanly #2356
Labels
Comments
bdarnell
changed the title
tornado.queues not work
tornado.queues consumers are difficult to stop cleanly
Apr 20, 2018
The queue is working, it is just logging a message at shutdown because the consumer task never exited. I recommend not worrying about this message - getting rid of all messages like this is generally more trouble than it's worth. We could add a |
bdarnell
added a commit
to bdarnell/tornado
that referenced
this issue
May 15, 2023
Per the warning in the asyncio documentation, we need to hold a strong reference to all asyncio Tasks to prevent premature GC. Following discussions in cpython (python/cpython#91887), we hold these references on the IOLoop instance to ensure that they are strongly held but do not cause leaks if the event loop itself is discarded. This is expected to fix all of the various "task was destroyed but it is pending" warnings that have been reported. The IOLoop._pending_tasks set is expected to become obsolete if corresponding changes are made to asyncio in Python 3.13. Fixes tornadoweb#3209 Fixes tornadoweb#3047 Fixes tornadoweb#2763 Some issues involve this warning as their most visible symptom, but have an underlying cause that should still be addressed. Updates tornadoweb#2914 Updates tornadoweb#2356
jack-hegman
pushed a commit
to jack-hegman/tornado
that referenced
this issue
Aug 16, 2023
Per the warning in the asyncio documentation, we need to hold a strong reference to all asyncio Tasks to prevent premature GC. Following discussions in cpython (python/cpython#91887), we hold these references on the IOLoop instance to ensure that they are strongly held but do not cause leaks if the event loop itself is discarded. This is expected to fix all of the various "task was destroyed but it is pending" warnings that have been reported. The IOLoop._pending_tasks set is expected to become obsolete if corresponding changes are made to asyncio in Python 3.13. Fixes tornadoweb#3209 Fixes tornadoweb#3047 Fixes tornadoweb#2763 Some issues involve this warning as their most visible symptom, but have an underlying cause that should still be addressed. Updates tornadoweb#2914 Updates tornadoweb#2356 (cherry picked from commit bffed1a)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While using tornado 5.0.2, the following code will report
ERROR:asyncio:Task was destroyed but it is pending! task: <Task pending coro=<consumer() running at a.py:18> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x10eb7a6a8>()]> cb=[IOLoop.add_future.<locals>.<lambda>() at /usr/local/lib/python3.6/site-packages/tornado/ioloop.py:720]>
this code is copied from http://www.tornadoweb.org/en/stable/queues.html
The text was updated successfully, but these errors were encountered: