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 janfrederik.konopka
Recipients aeros, janfrederik.konopka, pitrou, tomMoral, vstinner
Date 2021-04-26.23:08:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Hi all!

While browsing StackOverflow I came across this question:

The user created a ThreadPoolExecutor which started a Process using multiprocessing. The Process produces an exitcode of 0 in Python 3.8 but an exitcode of 1 in Python 3.9.

I'm really not familiar with Python internals, but through monkey-patching Lib/concurrent/futures/ I was able to pin this regression down to the change of 
> atexit.register(_python_exit)
> threading._register_atexit(_python_exit)
which led me to this issue! (:

I know that multiprocessing in Python is a little funky, since I worked with it on my Master's thesis. I think the entire process gets forked (i.e. copied), so the child process also gets a copy of the active ThreadPoolExecutor, which I think causes some sort of problem there. Note that this behavior seems to differ based on OS. I can confirm the issue on Linux with the 'fork' method and disconfirm it with the 'spawn' and 'forkserver' methods.

Could someone with more insight kindly take a look at this?

Greetings Jan <3
Date User Action Args
2021-04-26 23:08:54janfrederik.konopkasetrecipients: + janfrederik.konopka, pitrou, vstinner, tomMoral, aeros
2021-04-26 23:08:53janfrederik.konopkasetmessageid: <>
2021-04-26 23:08:53janfrederik.konopkalinkissue39812 messages
2021-04-26 23:08:53janfrederik.konopkacreate