Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

wasi-http: dropping incoming-response silently closes request connection #7413

Closed
dicej opened this issue Oct 30, 2023 · 1 comment · Fixed by #7426
Closed

wasi-http: dropping incoming-response silently closes request connection #7413

dicej opened this issue Oct 30, 2023 · 1 comment · Fixed by #7426
Assignees

Comments

@dicej
Copy link
Contributor

dicej commented Oct 30, 2023

While implementing a test for outbound request body streaming (#7412), I discovered that dropping the incoming-response object would cause the request connection to be closed, even if I still had open handles to the request body and stream.

For example, if I insert drop(response); to https://github.com/dicej/wasmtime/blob/1782a165754a2dd62f45cbc670603cc85477323b/crates/test-programs/src/bin/api_proxy_streaming.rs#L129, the test will fail with no (or few) bytes copied. The behavior I expected was that the test would pass (i.e. all bytes would be copied) regardless of whether the response handle was dropped or not.

@pchickey
Copy link
Contributor

The worker task that manages the connection lives here: https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasi-http/src/types.rs#L264 It looks like we need to hold an Arc to it both there and in the HostIncomingBody.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants