Andrew Svetlov added the comment:
asyncio doesn't kill subprocess by timeout, that's why test1() doesn't work.
The kill is done by signal sending which is asynchronous. That's why test2 may
fail at "FAIL(3)" point sometimes.
1-second sleep is enough to stop this case, but maybe not enough,
Caleb Hattingh added the comment:
@dontbugme This is a very old problem with threads and sub-processes. In the
general case (cross-platform, etc) it is difficult to kill threads and
sub-processes from the outside. The traditional solution is to somehow send a
message to the thread or
Terry J. Reedy added the comment:
There have been changes to asyncio since 3.6. I you have not, please check the
3.8 version to see if any of them are relevant to your issue.
--
nosy: +terry.reedy
___
Python tracker
New submission from dontbugme :
I'm trying to use asyncio.subproceess and am having difficulty killing the
subprocesses after timeout. My use case is launching processes that hold on to
file handles and other exclusive resources, so subsequent processes can only be
launched after the first