Stream: git-wasmtime

Topic: wasmtime / PR #13891 Drop host stream producers and consu...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 16 2026 at 20:21):

macovedj opened PR #13891 from macovedj:dropped-stream-bug to bytecodealliance:main:

When guest streams receive StreamResult::Dropped on their first poll (like would occur when hitting EOF), wasmtime is failing to transition from ReadState::HostReady/WriteState::HostReady to Dropped, so the host StreamProducer/StreamConsumer is never dropped and its completion future never resolves, leaving guest awaits hung.

This PR checks for Dropped and transitions when this occurs, in the same fashion as pipe_to_guest and pipe_from_guest already do today.

I created a little repro repo here that reproduces the hang and runs clean with these changes.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 16 2026 at 20:21):

macovedj requested wasmtime-core-reviewers for a review on PR #13891.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 16 2026 at 20:21):

macovedj requested pchickey for a review on PR #13891.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 16 2026 at 20:24):

macovedj updated PR #13891.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 16 2026 at 20:24):

macovedj edited PR #13891.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 16 2026 at 21:22):

alexcrichton unassigned pchickey from PR #13891 Drop host stream producers and consumers after StreamResult::Dropped.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 16 2026 at 21:22):

alexcrichton requested alexcrichton for a review on PR #13891.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2026 at 00:02):

github-actions[bot] added the label wasmtime:api on PR #13891.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2026 at 17:13):

:speech_balloon: alexcrichton created PR review comment:

Similar to above could this be refactored with pipe_to_guest to reduce duplication?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2026 at 17:13):

:speech_balloon: alexcrichton created PR review comment:

The handling here is I believe a duplicate (mostly) of pipe_from_guest where that function handles the dropped case and this function previously didn't but now does. Would you be up for a refactor to extract the "move the state forward after an event function" to be shared between here and pipe_from_guest? That way there'd in theory be less duplication and less chance this proves an issue in the future

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2026 at 17:13):

:memo: alexcrichton submitted PR review:

Thanks for this! I believe this is correct but I'd ideally like to refactor things to avoid duplication to prevent something like this cropping up in the future, so I'm curious on your thoughts on the below

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2026 at 19:04):

macovedj updated PR #13891.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2026 at 19:06):

macovedj commented on PR #13891:

Thanks for this! I believe this is correct but I'd ideally like to refactor things to avoid duplication to prevent something like this cropping up in the future, so I'm curious on your thoughts on the below

Yep that concern makes sense to me. I just had a go at extracting it out. I'm pretty sure the logic I extracted is equivalent to what we were doing in all cases before.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2026 at 19:13):

:thumbs_up: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2026 at 19:13):

alexcrichton has enabled auto merge for PR #13891.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2026 at 19:15):

alexcrichton added PR #13891 Drop host stream producers and consumers after StreamResult::Dropped to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2026 at 19:40):

:check: alexcrichton merged PR #13891.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2026 at 19:40):

alexcrichton removed PR #13891 Drop host stream producers and consumers after StreamResult::Dropped from the merge queue.


Last updated: Jul 29 2026 at 05:03 UTC