Skip to content

implement new stream/future trap conditions #215

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2025

Conversation

dicej
Copy link
Collaborator

@dicej dicej commented Jun 13, 2025

As of WebAssembly/component-model#524, we now trap if a guest tries to use a stream or future handle (besides dropping it) after it is "done" (see that PR for what "done" means). This required more careful tracking of the state of each end of the stream or future.

In the process of debugging this into shape, I added some trace logging and addressed a couple of issues I noticed:

  • wasi-http's Response::into_http wasn't noticing a non-empty buffer at the end of a stream
  • the p3_http_middleware test was not clearing its buffer before each read

As of WebAssembly/component-model#524, we now trap if a
guest tries to use a stream or future handle (besides dropping it) after it is
"done" (see that PR for what "done" means).  This required more careful tracking
of the state of each end of the stream or future.

In the process of debugging this into shape, I added some trace logging and
addressed a couple of issues I noticed:

- `wasi-http`'s `Response::into_http` wasn't noticing a non-empty buffer at the end of a stream
- the `p3_http_middleware` test was not clearing its buffer before each read

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej dicej added this pull request to the merge queue Jun 13, 2025
Merged via the queue into main with commit 93576ab Jun 13, 2025
44 checks passed
@dicej dicej deleted the dicej/trappy-streams-and-futures branch June 13, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant