macovedj opened PR #14490 from macovedj:subtask-cancel-lifetime to bytecodealliance:main:
A guest can request asynchronous cancellation and then attempt to drop
the subtask before cancellation finishes. Previously,subtask.cancel
immediately marked the host task as done, allowing that drop even when
cancellation returnedBLOCKED.This can remove a task entry that the completion worker still references.
If another host call reuses the slot, the old completion can report
RETURN_CANCELLEDfor the new task, even though it was never cancelled.This PR introduces
CalleeCancellingto preserve the task entry while completion
processing is pending and rejectssubtask.dropuntil that processing has
finished and the terminal event has been delivered.
macovedj requested cfallin for a review on PR #14490.
macovedj requested wasmtime-core-reviewers for a review on PR #14490.
cfallin unassigned cfallin from PR #14490 Keep host subtasks alive until cancellation completes.
cfallin requested dicej for a review on PR #14490.
cfallin commented on PR #14490:
(Going to hand off review to @dicej if that's OK, as I'm not that familiar with
concurrent.rs-- I should change that eventually, but in the meantime I'm not the best reviewer, sorry!)
macovedj updated PR #14490.
:thumbs_up: dicej submitted PR review:
Thanks, @macovedj!
dicej added PR #14490 Keep host subtasks alive until cancellation completes to the merge queue.
:check: dicej merged PR #14490.
dicej removed PR #14490 Keep host subtasks alive until cancellation completes from the merge queue.
Last updated: Oct 11 2026 at 04:10 UTC