gfx requested Copilot for a review on PR #13515.
gfx opened PR #13515 from wado-lang:fix-component-host-transmit-leak to bytecodealliance:main:
Fixes #13514.
When the guest drops its end of a stream/future while the host consumer/producer is still
HostReady, the transmit was never reclaimed. This finalizes the stranded host end so theTransmitStateand both handles are freed.Fix
crates/wasmtime/src/runtime/component/concurrent/futures_and_streams.rs— twoHostReadyarms were no-ops; both now calldelete_transmit(which also drops the host producer/consumer):
host_drop_reader(guest dropped the read end → host producer): the read end is alreadyDropped, so finalize unconditionally.host_drop_writer(guest dropped the write end → host consumer): the write end isn't forcedDroppedhere, so finalize only once the writer is actually gone.Tests
Two regression tests in
component-async-tests, driving only the publicStreamReader::pipe/FutureReader::newAPIs:
streams::async_host_consumer_drop(+ a minimalhost-consumer-drop-guesttest program) — covershost_drop_writer.streams::async_host_producer_drop(reuses the existingclosed-streamsguest) — covershost_drop_reader.Both fail on
main(leftover concurrent-state entries viaassert_concurrent_state_empty) and pass with this change.Verification
cargo test -p component-async-tests --test test_all→ 82 passed, 0 failed.
gfx requested dicej for a review on PR #13515.
gfx requested wasmtime-core-reviewers for a review on PR #13515.
gfx updated PR #13515.
gfx updated PR #13515.
gfx updated PR #13515.
github-actions[bot] added the label wasmtime:api on PR #13515.
Last updated: Jun 01 2026 at 09:49 UTC