dicej assigned dicej to issue #11703.
dicej opened issue #11703:
Consider a guest program targeting the WASIp3
proxyworld that simply echoes the request headers, body, and trailers back to the client:async fn handle(request: Request) -> Result<Response, ErrorCode> { let headers = request.get_headers(); let (body, trailers) = request.consume_body().unwrap(); Ok(Response::new(headers, Some(body), trailers).0) }If you run that with
wasmtime serveand use e.gcurl -i -H 'content-type: text/plain' --data "hello, world!" http://localhost:8080/echoto send a request, you'll find that the headers are echoed but the body is not. I haven't had a chance to debug this yet, but I suspect this is due towasmtime serveonly running the instance's event loop until thehandletask has exited. In this case, that's not enough, since the inbound stream has not finished (or, apparently, even started) being piped to the outbound stream.This is related to the concern I raised here, but I didn't realize at the time how easy it would be to reproduce.
dicej added the wasm-proposal:component-model-async label to Issue #11703.
dicej edited issue #11703:
Consider a guest program targeting the WASIp3
proxyworld that simply echoes the request headers, body, and trailers back to the client:async fn handle(request: Request) -> Result<Response, ErrorCode> { let headers = request.get_headers(); let (body, trailers) = request.consume_body().unwrap(); Ok(Response::new(headers, Some(body), trailers).0) }If you run that with
wasmtime serveand use e.gcurl -i -H 'content-type: text/plain' --data "hello, world!" http://localhost:8080/echoto send a request, you'll find that the headers are echoed but the body is not. I haven't had a chance to debug this yet, but I suspect this is due towasmtime serveonly running the instance's event loop until thehandletask has exited. In this case, that's not enough, since the inbound stream has not finished (nor, apparently, even started) being piped to the outbound stream.This is related to the concern I raised here, but I didn't realize at the time how easy it would be to reproduce.
dicej edited issue #11703:
Consider a guest program targeting the WASIp3
proxyworld that simply echoes the request headers, body, and trailers back to the client:async fn handle(request: Request) -> Result<Response, ErrorCode> { let headers = request.get_headers(); let (body, trailers) = request.consume_body().unwrap(); Ok(Response::new(headers, Some(body), trailers).0) }If you run that with
wasmtime serveand use e.gcurl -i -H 'content-type: text/plain' --data "hello, world!" http://localhost:8080/echoto send a request, you'll find that the headers are echoed but the body is not. I haven't had a chance to debug this yet, but I suspect this is due towasmtime serveonly running the instance's event loop until thehandletask has exited. In this case, that's not enough, since the inbound stream has not finished (nor, apparently, even started) being piped to the outbound stream.This is related to the concern I raised here, but I didn't realize at the time how easy it would be to reproduce.
dicej closed issue #11703:
Consider a guest program targeting the WASIp3
proxyworld that simply echoes the request headers, body, and trailers back to the client:async fn handle(request: Request) -> Result<Response, ErrorCode> { let headers = request.get_headers(); let (body, trailers) = request.consume_body().unwrap(); Ok(Response::new(headers, Some(body), trailers).0) }If you run that with
wasmtime serveand use e.gcurl -i -H 'content-type: text/plain' --data "hello, world!" http://localhost:8080/echoto send a request, you'll find that the headers are echoed but the body is not. I haven't had a chance to debug this yet, but I suspect this is due towasmtime serveonly running the instance's event loop until thehandletask has exited. In this case, that's not enough, since the inbound stream has not finished (nor, apparently, even started) being piped to the outbound stream.This is related to the concern I raised here, but I didn't realize at the time how easy it would be to reproduce.
dicej commented on issue #11703:
This was addressed by #11763
Last updated: Dec 06 2025 at 07:03 UTC