[issue34037] asyncio: BaseEventLoop.close() shutdowns the executor without waiting causing leak of dangling threads

STINNER Victor report at bugs.python.org
Tue Jun 4 08:08:53 EDT 2019


STINNER Victor <vstinner at redhat.com> added the comment:

> The problem is that loop.close() can "hang" for minutes if there are pending background jobs or slow DNS resolution requests.

Maybe concurrent.futures should be enhanced for that?

Or from asyncio, is it possible to poll the executor and emit a warning if some threads take longer than <threshold in esconds>? It would be great if we could display repr() of the slow job in that case.

Yury also asked for a timeout, but it's not supported by concurrent.futures yet, and I'm not sure what should be done in case of timeout? Retry? Log a warning?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34037>
_______________________________________


More information about the Python-bugs-list mailing list