Repository navigation
Rename TaskFuture.abort to request_stop, execute subprocess tasks with pebble, add abort and kill - #501
Rename TaskFuture.abort to request_stop, execute subprocess tasks with pebble, add abort and kill#501woutdenolf wants to merge 10 commits into
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Task.request_stop and Task.stop_requestedbd36fbe to
b30ecf5
Compare
625bc0f to
3d4fbd7
Compare
f91d853 to
f720b36
Compare
| return self._denial | ||
|
|
||
|
|
||
| class TaskController(ABC): |
There was a problem hiding this comment.
Review tip: start by reading the docstrings of these changed class methods.
…op_requested Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5f7266e to
3ef0155
Compare
94942ee to
67f93e0
Compare
…ture.kill, and never start a queued task that is stopped, aborted or killed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cts to avoid a crash at exit on Windows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e271965 to
62bd8ba
Compare
…nd every execution with finished, and release a failed submission Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
62bd8ba to
151dcea
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
151dcea to
91ae215
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58007eb to
08c86f3
Compare
08c86f3 to
7d07c0e
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7d07c0e to
4ba8ca5
Compare
|
I have trouble reviewing the PR to be honest (I am a human 🤣 ). Even with the tip. This is too massive for me. I tried twice and even if a lot of it is tests I fail to review. the first commit already reworks several things. Could we split this PR into several smaller ones (that can be on top of each others) - AI can probably do it ? Here is a suggestion: |
PR summary
abort(interrupts the task like Ctrl-C, with cleanup) andkill(terminates the worker process). Both work only with a process pool, which now usespebble. They come on top ofcancelandrequest_stop.cancel,request_stop,abortorkillon a task that is still queued prevents it from starting.cancelon the thread and sync backends also cancels the future, which completes right away.killalso cancels thepebblefuture, which completes right away.cancel,request_stopandabortdo not cancel thepebblefuture: cancelling it kills the worker if one just picked up the task, which would turn them into akill.Try-out cancel vs. stop vs. abort vs. kill with
Click Submit x5 (Process parallel) followed by cancel, stop, abort or kill
AI Disclosure
Details
🤖 Generated with Claude Code
Subprocess execution
pebble.ProcessPool(new dependency) instead ofProcessPoolExecutor: a killed worker no longer breaks the pool.EwoksExecutorraisesTypeErrorfor aconcurrent.futures.ProcessPoolExecutor.pebble.ProcessPoolworker.Stopping a running task
TaskFuture.abort/aborted→request_stop/stop_requested, and theabortedsignal →stopRequested(not released yet).stopRequestedsignal is emitted with the completion.TaskFuture.abort(): interrupt like Ctrl-C. The task can clean up and the worker survives. Subprocess only.TaskFuture.kill(): terminate the worker. No cleanup, the pool replaces the worker. Subprocess only.abortedandkilledsignals, andTaskFuture.aborted()/killed().Queued and finished tasks
cancel(),request_stop(),abort()orkill()(abort()andkill(): process pool only). Itsresult()raises:CancelledErroraftercancel()TaskStoppedErrorafterrequest_stop()TaskAbortedErrorafterabort()orkill()aboutToStartorstarted.False.False.Signal order
kill()from the GUI thread.Qt.DirectConnectiondelays the relay thread or callskill().finished: a cancelled task emitscancelledandfinished(the widget no longer stays pending).submit()no longer leaves the executor busy.cancelledandfinished.Documentation
concurrency.rst: a contract for widget authors and corrected diagrams for maintainers.Windows crash at exit
ewoksorange_qtappteardown deletes the remaining Python-owned Qt objects.Tests and demo