This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Alexander Overvoorde
Recipients Alexander Overvoorde
Date 2020-05-07.20:01:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1588881684.43.0.416849020134.issue40550@roundup.psfhosted.org>
In-reply-to
Content
The following program frequently raises a ProcessLookupError exception when calling proc.terminate():

```
import threading
import subprocess
import multiprocessing

proc = subprocess.Popen(["sh", "-c", "exit 0"])

q = multiprocessing.Queue()

def communicate_thread(proc):
    proc.communicate()

t = threading.Thread(target=communicate_thread, args=(proc,))
t.start()

proc.terminate()

t.join()
```

I'm reproducing this with Python 3.8.2 on Arch Linux by saving the script and rapidly executing it like this:

$ bash -e -c "while true; do python3 test.py; done

The (unused) multiprocessing.Queue seems to play a role here because the problem vanishes when removing that one line.
History
Date User Action Args
2020-05-07 20:01:24Alexander Overvoordesetrecipients: + Alexander Overvoorde
2020-05-07 20:01:24Alexander Overvoordesetmessageid: <1588881684.43.0.416849020134.issue40550@roundup.psfhosted.org>
2020-05-07 20:01:24Alexander Overvoordelinkissue40550 messages
2020-05-07 20:01:24Alexander Overvoordecreate