How to terminate long-running computation (CPU bound task) in Python using asyncio and concurrent.futures.ProcessPoolExecutor?
How do I terminate such long running CPU-bound computations within a method? The approach you tried doesn’t work because the futures returned by ProcessPoolExecutor are not cancellable. Although asyncio’s run_in_executor tries to propagate the cancellation, it is simply ignored by Future.cancel once the task starts executing. There is no fundamental reason for that. Unlike threads, … Read more