qml: add backend task outcomes and cancellation #1109

Open
pseudoramdom wants to merge 3 commits from backendExecutor-improvements into qt6 AGit
pseudoramdom commented 2026-11-10 18:45:57 +00:00 (Migrated from github.com)

Add an explicit task lifecycle to BackendExecutor:

Key changes

  • Introduce submitTask() with task IDs and queued success, failure, or cancellation outcomes.
  • Report queued cancellation promptly; optionally discard running results after work returns.
  • Add whenDrained() callbacks that survive executor destruction.
  • Preserve worker-side cleanup, the existing submit() API, and shutdown draining behavior.

Not included

  • Model migrations and async helpers remain outside this PR.

Mostly fixes #1054

Add an explicit task lifecycle to BackendExecutor: ### Key changes - Introduce submitTask() with task IDs and queued success, failure, or cancellation outcomes. - Report queued cancellation promptly; optionally discard running results after work returns. - Add whenDrained() callbacks that survive executor destruction. - Preserve worker-side cleanup, the existing submit() API, and shutdown draining behavior. ### Not included - Model migrations and async helpers remain outside this PR. Mostly fixes #1054
rreview commented 2026-11-10 20:44:30 +00:00 (Migrated from github.com)

🔵 Suggestion · Blocking on drain inside a task completion deadlocks

A submitTask completion that synchronously waits for its own executor to drain deadlocks, even with a nested event loop; no production caller currently uses this API, but its contract omits the restriction.

Location: qml/backendexecutor.cpp:82 (head).

Review coverage was incomplete.


Reviewed: 000e49c81e60 · Review report

<!-- ralph-major:bitcoin-core/gui-qml --> **🔵 Suggestion · Blocking on drain inside a task completion deadlocks** A `submitTask` completion that synchronously waits for its own executor to drain deadlocks, even with a nested event loop; no production caller currently uses this API, but its contract omits the restriction. Location: [qml/backendexecutor.cpp:82](<https://github.com/bitcoin-core/gui-qml/blob/000e49c81e60ccf6560ccdd1a93e811a5a44c475/qml/backendexecutor.cpp#L82>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`000e49c81e60`](<https://github.com/bitcoin-core/gui-qml/commit/000e49c81e60ccf6560ccdd1a93e811a5a44c475>) · [Review report](<https://review.fish.foo/report/gui/1109-000e49c81e60ccf6560ccdd1a93e811a5a44c475-2479-1.html>)
Sign in to join this conversation.
No description provided.