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 vstinner
Recipients gregory.p.smith, izbyshev, jbms, vstinner
Date 2021-09-24.11:20:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1632482442.46.0.122541402799.issue42969@roundup.psfhosted.org>
In-reply-to
Content
> In this case that unexpected thread simply disappearing can lead to a deadlock in our process.

This problem also remains me the very complex case of bpo-6721: "Locks in the standard library should be sanitized on fork". The issue title looks simple, but 12 years after the issue was created, it's still open.

This issue is being solved by adding atfork callbacks to modules which must do something at fork in the child process (sometimes also in the parent process).

I added threading.Lock._at_fork_reinit() private method to simplify the implementation of these callbacks.

Such problem has no silver bullet solution, so it's better to let developers design their own solution with their specific requirements.
History
Date User Action Args
2021-09-24 11:20:42vstinnersetrecipients: + vstinner, gregory.p.smith, izbyshev, jbms
2021-09-24 11:20:42vstinnersetmessageid: <1632482442.46.0.122541402799.issue42969@roundup.psfhosted.org>
2021-09-24 11:20:42vstinnerlinkissue42969 messages
2021-09-24 11:20:42vstinnercreate