Skip to content

CABI: tighten subtask.cancel behavior - #723

Merged
lukewagner merged 1 commit into
mainfrom
test-cancel
Sep 16, 2026
Merged

lukewagner merged 1 commit into
mainfrom
test-cancel

Conversation

@lukewagner

Copy link
Copy Markdown
Member

The recent PR #716 attempted to give the host more flexibility for which-and-how-many of the subtask's threads are to be resumed during subtask.cancel by replacing the candidates set with a plain thread.yield. But thread.yield actually isn't quite right and while testing Wasmtime I see that's both more-permissive and less-permissive in different cases. This new PR aims to fix this in a way that matches Wasmtime's behavior (which seems pretty reasonable from what I can tell) as tested by a set of new WAST tests that all currently pass. But @dicej and @alexcrichton lemme know if the new rules described in the PR sound right or if I'm missing something.

@alexcrichton alexcrichton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems reasonable to me, although this is an aspect of Wasmtime which is "probably whatever just happened to or was easiest to implement" so I wouldn't want to over-rotate on this too too much. This is a spec corner that seems possible to tweak in the future if necessary, however, and I'm always a fan of more tests!

@dicej dicej left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM; thanks for the new tests!

@lukewagner
lukewagner merged commit 07afb81 into main Sep 16, 2026
2 checks passed
@lukewagner
lukewagner deleted the test-cancel branch September 16, 2026 18:11
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.

3 participants