[issue33727] Server.wait_closed() doesn't always wait for its transports to fihish
Tom
report at bugs.python.org
Fri Aug 14 09:48:19 EDT 2020
Tom <tom at collider.in> added the comment:
I ran into this while working on an asyncio application using
asyncio.start_server.
>From the documentation, I expected the combination of `close` and `wait_closed`
to wait until all connection handlers have finished. Instead, handlers remaining
running with open connections as background tasks. I wanted to be able to
"gracefully" close the server, with all processing done, so I could inspect some
results for a test case.
Could there be a method for this? One suggestion would be:
* Clarify the current behaviour of `close` and `wait_closed`
(https://bugs.python.org/issue34852)
* Add new coro `wait_finished` which waits until all handler tasks are done
I'm afraid I'm not familiar with low-level asyncio APIs like transports and
protocols, so I don't know how/if this fits in with those.
----------
nosy: +tmewett
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33727>
_______________________________________
More information about the Python-bugs-list
mailing list