On 09/03/2020 17:50, Remy NOEL wrote:
I ran into a problem which, according to a google search is not that uncommon: concurrent.futures ThreadPoolExecutor, installs an exit handler preventing program exit if any of the jobs it is running is blocked. (Which might be a surprising behaviour to someone using those).
It is possible to workaround this problem by either unregistering the exit handler concurrent.futures.thread._python_exit or by subclassing the threadpoolExecutor and overriding the _adjust_thread_count method with one that does not register its threads queues.
Both seems kinda ugly though.
Well, yes. The non-ugly thing would be to make sure your threads are well behaved ;-)