You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In GitLab by @loichuder on Jan 23, 2026, 15:09 GMT+1:
OWEwoksWidgetOneThread is a great abstraction allowing to run the task in a thread. This gives an easy way of having a responsive GUI while the task is running.
Unfortunately, threads cannot be killed so aborting/canceling the task is tricky.
I would propose to create a new Orange Ewoks widget to run the tasks in a multiprocess.Process instead. With a bit a care, processes can be killed to cancel ongoing tasks. This new widget could provide a nice abstraction like OWEwoksWidgetOneThread so that ewoksapps devs do not need to deal with implementation details.
Yes, the processing happens here, and it supports cancellation. For now, it's up to each task to decide how to handle aborting. We could probably implement something more generic for this.
Task is asked to finish early, it may ignore the request, unclear whether an exception is raised or not
Task can only do the last one, so stop. Futures can potentially do all three (perhaps call that halt). Or maybe abort and stop should always cancel when still pending.
Note that Celery uses revoke(terminate=False) for our cancel and revoke(terminate=True) for our cancel+abort.
Activity
poautran commentedon Jan 23, 2026
In GitLab by @woutdenolf on Jan 23, 2026, 15:32 GMT+1:
Yes please. I think I proposed this already but got rejected.
poautran commentedon Jan 23, 2026
In GitLab by @loichuder on Jan 23, 2026, 15:37 GMT+1:
For the record, here are two working process-based executors (courtesy of @tvincent):
Qobject: https://gitlab.esrf.fr/levantin/txs/-/blob/master/txs/app/ProcessWorker.py?ref_type=headsFuture: https://gitlab.esrf.fr/ui/tomovis/-/blob/main/tomovis/subprocess_executor.py?ref_type=headswoutdenolf commentedon Aug 3, 2026
Multi-processing is almost implemented. See #434
payno commentedon Oct 7, 2026
Yes, the processing happens here, and it supports cancellation. For now, it's up to each task to decide how to handle aborting. We could probably implement something more generic for this.
woutdenolf commentedon Oct 7, 2026
For reference, the vocabulary I propose
cancelabortstopTaskcan only do the last one, sostop. Futures can potentially do all three (perhaps call thathalt). Or maybeabortandstopshould alwayscancelwhen still pending.Note that Celery uses
revoke(terminate=False)for ourcancelandrevoke(terminate=True)for ourcancel+abort.https://docs.celeryq.dev/en/2.5-archived/userguide/workers.html#revoking-tasks
loichuder commentedon Oct 9, 2026
Unassigning myself since I had a look and I don't understand how to implement this with the new architecture.
loichuder commentedon Oct 9, 2026
I mean, Claude is telling me that
is enough.
But how to handle aborting in this case?
woutdenolf commentedon Oct 10, 2026
ewoksorangemain now runs tasks in a subprocess (#434). No dedicated widget class is needed: passconcurrency="process"as a class argument.The
TaskFuture(returned byexecute_ewoks_task()or emitted bytask_executor.started) has:future.cancel(): the task never runs (only works while it is still queued).future.abort(): today this is cooperative.task.cancelledin the worker process and callstask.cancel().What is still missing for this issue
abortshould kill the task, whether it cooperates or not. That is the whole point of running it in a process.stop, following the vocabulary in New OWEwoksWidget to run tasks in a process #82 (comment):cancel: not started yet, the task never runsabort: running, the task is killedstop: running, the task is asked to finish earlyTask.cancel→Task.request_stopabort:ProcessPoolExecutorworker can't be terminated without breaking the pool (BrokenProcessPool).multiprocessing.Processper task, like the executors from @tvincent linked above.payno commentedon Oct 12, 2026
Ok so in addition to the renaming we need to add a
abortAPI but only atewoksorangelevel.