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 Ben.Darnell
Recipients Ben.Darnell, aeros, pitrou, vstinner
Date 2021-01-25.03:09:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1611544147.98.0.0351407221414.issue41962@roundup.psfhosted.org>
In-reply-to
Content
> IMO, a better practice would be providing those potentially infinite running tasks a direct method of escape and invoking it before calling executor.shutdown(), it would be a more reliable approach.

Agreed, but the problem is that I'm in a library (so I don't control the main module), and the library's interface does not mandate any sort of explicit shutdown method. There is a shutdown method, but almost no one calls it, and it's never caused a problem until Python 3.9 changed things so it deadlocks. 

> My only concern is that it might be a potential foot-gun. If the user submits an atexit hook that deadlocks, it might prevent threads from shutting down safely prior to interpreter finalization. 

Yes, and that is exactly the problem. concurrent.futures submits an atexit hook whose behavior depends on application code, and through that I have inadvertently caused a deadlock.
History
Date User Action Args
2021-01-25 03:09:08Ben.Darnellsetrecipients: + Ben.Darnell, pitrou, vstinner, aeros
2021-01-25 03:09:07Ben.Darnellsetmessageid: <1611544147.98.0.0351407221414.issue41962@roundup.psfhosted.org>
2021-01-25 03:09:07Ben.Darnelllinkissue41962 messages
2021-01-25 03:09:07Ben.Darnellcreate