Stream: git-wasmtime

Topic: wasmtime / issue #9667 wasi-io: Unexpected tcp stream bre...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 27 2024 at 07:51):

Heap-Hop edited issue #9667:

https://github.com/bytecodealliance/wasmtime/blob/67674881db5fbdbba8594feb52655aaa351a5f77/crates/wasi/src/tcp.rs#L719-L723

Returning 0 for std::io::ErrorKind::WouldBlock causes downstream to interpret it as a closed stream, see:
https://github.com/yoshuawuyts/wstd/issues/25#issuecomment-2493294087.
https://github.com/yoshuawuyts/wstd/blob/5ce367add5e7bcb569b6487453cb9ba94468dc99/src/io/copy.rs#L12

This is also found in:
https://github.com/bytecodealliance/wasmtime/blob/67674881db5fbdbba8594feb52655aaa351a5f77/crates/test-programs/src/bin/preview2_tcp_streams.rs#L17-L22

Given that the wit files already include many would-block errors, would it make sense to extend stream-error to include a would-block?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 27 2024 at 07:52):

Heap-Hop edited issue #9667:

https://github.com/bytecodealliance/wasmtime/blob/67674881db5fbdbba8594feb52655aaa351a5f77/crates/wasi/src/tcp.rs#L719-L723

Returning 0 for std::io::ErrorKind::WouldBlock causes downstream to interpret it as a closed stream, see:
https://github.com/yoshuawuyts/wstd/issues/25#issuecomment-2493294087.
https://github.com/yoshuawuyts/wstd/blob/5ce367add5e7bcb569b6487453cb9ba94468dc99/src/io/copy.rs#L12

This is also found in:
https://github.com/bytecodealliance/wasmtime/blob/67674881db5fbdbba8594feb52655aaa351a5f77/crates/test-programs/src/bin/preview2_tcp_streams.rs#L17-L22

Given that the wit files already include many would-block errors, would it make sense to extend stream-error to include a would-block?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 27 2024 at 17:20):

pchickey commented on issue #9667:

Thanks, it sounds like this is indeed a bug in wasmtime-wasi then. Can you create a minimal reproduction so I can work on a fix and use it as a test once we have the fix in? Something along the lines of https://github.com/bytecodealliance/wasmtime/blob/main/crates/test-programs/src/bin/preview2_tcp_streams.rs


Last updated: Dec 23 2024 at 12:05 UTC