loky icon indicating copy to clipboard operation
loky copied to clipboard

Feature request: cancel futures

Open louisabraham opened this issue 5 years ago • 3 comments

Stopping long running jobs would be a really useful feature, in particular for Las Vegas algorithms that require restarts, or when evaluating generated programs (see tpot).

While googling, I saw that pebble implements this feature.

louisabraham avatar Oct 11 '18 20:10 louisabraham

Maybe it would be better to provide a special argument to confirm one really wants to kill a process if the task is already running.

louisabraham avatar Oct 11 '18 21:10 louisabraham

There is a method Future.cancel, which can cancels jobs that were not already dispatched. Also, it is possible to shutdown the executor with executor.shutdown(kill_workers=True, wait=True).

Did you have something more specific in mind?

tomMoral avatar Oct 31 '18 10:10 tomMoral

Pretty old issue but I have the same problem. I'd like to cancel futures (jobs) that run too long. But calling future.cancel() seems to have no effect on shutting down idle workers after the timeout is reached.

jvailius avatar Apr 11 '24 09:04 jvailius