Stream: git-wasmtime

Topic: wasmtime / issue #11703 `wasmtime serve` doesn't work whe...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2025 at 23:39):

dicej assigned dicej to issue #11703.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2025 at 23:39):

dicej opened issue #11703:

Consider a guest program targeting the WASIp3 proxy world 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 serve and use e.g curl -i -H 'content-type: text/plain' --data "hello, world!" http://localhost:8080/echo to 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 to wasmtime serve only running the instance's event loop until the handle task 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.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2025 at 23:39):

dicej added the wasm-proposal:component-model-async label to Issue #11703.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2025 at 23:40):

dicej edited issue #11703:

Consider a guest program targeting the WASIp3 proxy world 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 serve and use e.g curl -i -H 'content-type: text/plain' --data "hello, world!" http://localhost:8080/echo to 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 to wasmtime serve only running the instance's event loop until the handle task 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.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2025 at 23:53):

dicej edited issue #11703:

Consider a guest program targeting the WASIp3 proxy world 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 serve and use e.g curl -i -H 'content-type: text/plain' --data "hello, world!" http://localhost:8080/echo to 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 to wasmtime serve only running the instance's event loop until the handle task 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.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2025 at 21:30):

dicej closed issue #11703:

Consider a guest program targeting the WASIp3 proxy world 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 serve and use e.g curl -i -H 'content-type: text/plain' --data "hello, world!" http://localhost:8080/echo to 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 to wasmtime serve only running the instance's event loop until the handle task 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.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2025 at 21:30):

dicej commented on issue #11703:

This was addressed by #11763


Last updated: Dec 06 2025 at 07:03 UTC