Message350181
Oh, I found an issue with regrtest and Windows processes.
On Windows, when a process dies (crash or whatever), Popen.communicate() continues to hang in the parent if the died process has at least one child process which is still alive.
Test attached kill_timeout.py:
---
vstinner@WIN C:\vstinner\python\master>python x.py
Running Debug|x64 interpreter...
parent pid 1600
child1 pid 2184
child2 pid 4516
communicate(): timeout (1)
child1 killed
wait() returned: returncode 1
communicate() timeout (2)
---
Calling Popen.communicate() hangs even if the child process has been killed, whereas wait() completes immediately.
On Windows, Popen.communicate() is implemented with threads calling this function on each pipe:
def _readerthread(self, fh, buffer):
buffer.append(fh.read())
fh.close()
It seems like self.stdout.read() hangs even after the child process has been killed. |
|
Date |
User |
Action |
Args |
2019-08-22 10:44:50 | vstinner | set | recipients:
+ vstinner, jkloth, jeremy.kloth, eryksun, nanjekyejoannah |
2019-08-22 10:44:50 | vstinner | set | messageid: <1566470690.43.0.843884962339.issue37531@roundup.psfhosted.org> |
2019-08-22 10:44:50 | vstinner | link | issue37531 messages |
2019-08-22 10:44:50 | vstinner | create | |
|