WebAssembly / wasi-sockets

WASI API proposal for managing sockets
Other
248 stars 22 forks source link

UDP subscribe can't be split between read/write #64

Closed alexcrichton closed 1 year ago

alexcrichton commented 1 year ago

I'm debugging a flaky test right now in Wasmtime's CI, and one interesting behavior I'm seeing is that there's a blocking_receive helper for UDP sockets which tries to wait in a loop, and I was going to add an upper limit to the loop to help time it out. This loop, however, never blocks. The socket is always ready for I/O, despite the receive call not actually returning anything. Still trying to figure out the latter, but for the former I believe one issue is that the subscribe for UDP sockets is either readable or writable readiness right now so if a socket is acting as a server then there's no way to block it for read readiness since it's always writable if you're not writing.

badeend commented 1 year ago

Yup. Discovered the same thing yesterday. I was already working on an updated design. If it is causing issues for the CI, maybe we should temporarily comment the test out

alexcrichton commented 1 year ago

Nah no worries about CI, this ended up uncovering a separate bug (linked above) which needs to be orthogonally fixed. Wanted to file this to keep it on record though!