Deliver stream/future dropped events even when not reading/writing - #720
Merged
Merged
Conversation
dicej
approved these changes
Sep 14, 2026
Collaborator
|
Going over the failing tests here, those all look like bugs in wasmtime to me, yeah |
Collaborator
|
I'll work on getting the new tests passing. |
lukewagner
force-pushed
the
more-simplify
branch
from
September 14, 2026 20:45
35e9769 to
b5d1c47
Compare
lukewagner
force-pushed
the
more-drop
branch
from
September 14, 2026 22:18
87f68c3 to
107f204
Compare
Member
Author
|
Great! I'll fold these tweaks/tests into #719. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes another case where Wasmtime delivers
DROPPEDresults more-promptly than the spec Python definitions and probably Wasmtime is (mostly, see below) right. Specifically, if a readable or writable end of a stream or future is dropped while the other end is in a waitable set but idle (i.e., there is no{stream,future}.{read,write}in progress), it seems like a ({STREAM,FUTURE}_{READ,WRITE},DROPPED) event should be delivered to the waitable set, but currently the spec won't deliver anything until the next{stream,future}.{read,write}. (Before #719, this was was less obvious and hard to fix, but with #719 it's easy to spot and fix, so this PR is based on #719.)After updating the spec in this PR and writing a bunch of WAST tests to cover the interesting cases, there is one interesting remaining case where I think Wasmtime's current behavior isn't what we want to specify, but it's worth checking: after one of these
DROPPED-during-idle events is delivered to an end, it seems like that end should transition to theDONEstate, in which case the only valid operation on the end is{stream,future}.drop-{readable,writable}and other built-ins trap (just like whenDROPPEDis received while not idle). IIUC, Wasmtime doesn't change the state toDONEand this shows up in the last 6 failing cases at the very end oftest/async/idle-drop.wast. @alexcrichton @dicej lmkwyt though