Skip to content

EwoksExecutor: completion signals after start signals, finished for every execution - #509

Merged
woutdenolf merged 3 commits into
mainfrom
executor_signal_order
Oct 24, 2026
Merged

woutdenolf merged 3 commits into
mainfrom
executor_signal_order

Conversation

@woutdenolf

@woutdenolf woutdenolf commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Stack (split from #501, merge in order):

  1. Qt test fixes: drop test_owwidget_drop timing dependency, fix Windows crash at exit #506 Qt test fixes: drop test_owwidget_drop timing dependency, fix Windows crash at exit
  2. Rename TaskFuture.abort/aborted to request_stop/stop_requested #507 Rename TaskFuture.abort/aborted to request_stop/stop_requested
  3. Never start a queued task that is cancelled or stopped; two queues for the process backend #508 Never start a queued task that is cancelled or stopped; two queues for the process backend
  4. EwoksExecutor: completion signals after start signals, finished for every execution #509 EwoksExecutor: completion signals after start signals, finished for every execution 👈 this PR
  5. Execute subprocess tasks with pebble, add TaskFuture.abort and TaskFuture.kill #501 Execute subprocess tasks with pebble, add TaskFuture.abort and TaskFuture.kill
  6. Doc: executor contract, backend diagrams and glossary #510 Doc: executor contract, backend diagrams and glossary

PR summary

  • The completion signals are emitted after the start and progress signals.
    • Thread and process backends: the done callback emits an internal _done signal, queued to the executor thread.
  • Every submitted execution ends with finished.
    • A cancelled task emits cancelled and finished. The widget no longer stays pending.
  • Signal stop_requested → stopRequested, emitted with the completion.
  • A failed submit() no longer leaves the executor busy.

AI Disclosure

  • AI tools claude used for generate the code

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.67442% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ewoksorange/gui/concurrency/executor.py 97.43% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@woutdenolf
woutdenolf force-pushed the executor_signal_order branch from 0245b75 to 1a84e82 Compare October 22, 2026 08:55
"""Emitted when a task finishes (success, failure, or stop request)."""
"""Emitted last, for every submitted task."""

_done = Signal(object, object, object)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the three objects could be more typed (futures.Future[VariableContainer], TaskFuture, and _controllers.TaskController).
But is seems (to be confirmed) that only the TaskFuture is required - _handle_done only uses the task_future if I am correct. That would simplify and aligned things.

@woutdenolf woutdenolf Oct 24, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, only task_future is used. _done and _handle_done now take just that.

raw_future: futures.Future[VariableContainer],
task_future: TaskFuture,
controller: _controllers.TaskController,
queue_done: bool,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The queue_done is not really helping IMO. This is True when the executor exists. AI suggest defer_completion that seems fair to me.

Suggested change
queue_done: bool,
defer_completion: bool,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to defer_completion.

@woutdenolf
woutdenolf force-pushed the executor_signal_order branch from 1a84e82 to 04e56ab Compare October 24, 2026 08:21
…nd every execution with finished, and release a failed submission

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@woutdenolf
woutdenolf force-pushed the executor_signal_order branch from 04e56ab to d8ae60b Compare October 24, 2026 08:23
@woutdenolf
woutdenolf changed the base branch from process_start_gate to main October 24, 2026 08:23
woutdenolf and others added 2 commits October 24, 2026 10:26
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@woutdenolf
woutdenolf enabled auto-merge October 24, 2026 08:28
@woutdenolf
woutdenolf merged commit f55658a into main Oct 24, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants