persist WASIp3 HTTP handler until response body is drained#3454
Merged
dicej merged 1 commit intospinframework:mainfrom Apr 9, 2026
Merged
persist WASIp3 HTTP handler until response body is drained#3454dicej merged 1 commit intospinframework:mainfrom
dicej merged 1 commit intospinframework:mainfrom
Conversation
Prior to Wasmtime 43, we used the `TaskExit` return value from `call_handle` to wait for the task to complete after it had returned a value. However, that has been removed, so now the only way we know it's safe to exit the task passed to `ProxyHandler::spawn` is to attach a `oneshot::Sender` to the response body which will be notified when the body is dropped. We then `await` the corresponding `oneshot::Receiver`, at which point we know the guest has finished sending the response body. This also adds a test to cover the case. Finally, since Wasmtime 43.0.1 was released with important security fixes, I updated that as well.
itowlson
approved these changes
Apr 9, 2026
Collaborator
itowlson
left a comment
There was a problem hiding this comment.
Tried it with the SSE example and it worked great. Thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prior to Wasmtime 43, we used the
TaskExitreturn value fromcall_handleto wait for the task to complete after it had returned a value. However, that has been removed, so now the only way we know it's safe to exit the task passed toProxyHandler::spawnis to attach aoneshot::Senderto the response body which will be notified when the body is dropped. We thenawaitthe correspondingoneshot::Receiver, at which point we know the guest has finished sending the response body.This also adds a test to cover the case.
Finally, since Wasmtime 43.0.1 was released with important security fixes, I updated that as well.