joblib / loky

Robust and reusable Executor for joblib
http://loky.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
520 stars 47 forks source link

Feature request: cancel futures #176

Open louisabraham opened 5 years ago

louisabraham commented 5 years ago

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 commented 5 years ago

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.

tomMoral commented 5 years ago

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?

jvailius commented 2 months ago

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.