[issue30976] multiprocessing.Process.is_alive can show True for dead processes

2017-07-20 Thread Mick Phillips
Mick Phillips added the comment: Yep - apologies, my mistake. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ _

[issue30976] multiprocessing.Process.is_alive can show True for dead processes

2017-07-20 Thread Gareth Rees
Gareth Rees added the comment: This is a race condition — when os.kill returns, that means that the signal has been delivered, but it does not mean that the subprocess has exited yet. You can see this by inserting a sleep after the kill and before the liveness check: print(proc.is_alive())

[issue30976] multiprocessing.Process.is_alive can show True for dead processes

2017-07-20 Thread Mick Phillips
New submission from Mick Phillips: multiprocessing.Process.is_alive() returns True for processes that have been killed. See attached for example. Workaround: also test against psutils.pid_exists. -- components: Windows files: alive.py messages: 298724 nosy: davin, mickp, paul.moore, st