python / cpython

The Python programming language
https://www.python.org
Other
63.66k stars 30.49k forks source link

[3.12] gh-88110: Clear concurrent.futures.thread._threads_queues after fork to avoid joining parent process' threads (GH-126098) #127164

Open miss-islington opened 3 days ago

miss-islington commented 3 days ago

Threads are gone after fork, so clear the queues too. Otherwise the child process (here created via multiprocessing.Process) crashes on interpreter exit.

(cherry picked from commit 1848ce61f349533ae5892a8c24c2e0e3c364fc8a)

Co-authored-by: Andrei Bodrov Drino@users.noreply.github.com Co-authored-by: Serhiy Storchaka storchaka@gmail.com