Message385598
> 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. |
|
Date |
User |
Action |
Args |
2021-01-25 03:09:08 | Ben.Darnell | set | recipients:
+ Ben.Darnell, pitrou, vstinner, aeros |
2021-01-25 03:09:07 | Ben.Darnell | set | messageid: <1611544147.98.0.0351407221414.issue41962@roundup.psfhosted.org> |
2021-01-25 03:09:07 | Ben.Darnell | link | issue41962 messages |
2021-01-25 03:09:07 | Ben.Darnell | create | |
|