Pass transmission errors to the future from {request, response}.new - #14148
Open
adamrk wants to merge 5 commits into
Open
Pass transmission errors to the future from {request, response}.new#14148adamrk wants to merge 5 commits into
{request, response}.new#14148adamrk wants to merge 5 commits into
Conversation
Contributor
Author
|
Current CI error seems to be Github's fault, but I don't have permissions to retry it. |
Contributor
|
I kicked it. LGTM but I'd like @dicej to take a look if he has a moment, he might spot subtle stuff related to these futures that aren't apparent to me. |
dicej
approved these changes
Aug 18, 2026
| @@ -61,7 +87,7 @@ impl<T> HostWithStore<T> for WasiHttp { | |||
| let (req, options) = | |||
| req.into_http_with_getter(&mut store, io_task_result(io_result_rx), getter)?; | |||
| HttpResult::Ok(store.get().hooks.send_request( | |||
| req.map(|body| body.with_state(io_task_rx).boxed_unsync()), | |||
| req.map(|body| body.boxed_unsync()), | |||
Contributor
There was a problem hiding this comment.
Is this map call still serving any purpose? Can we remove it?
Contributor
Author
There was a problem hiding this comment.
Yep, it's not needed anymore.
| io_result_rx.await.unwrap_or(Ok(())) | ||
| io_result_rx.await.unwrap_or_else(|_| { | ||
| Err(Error::InternalError(Some( | ||
| "Future indicating transmission result dropped without being resolved.".to_string(), |
Contributor
There was a problem hiding this comment.
Nit: consider moving the string literal into a named constant to avoid the duplication.
| body.with_state(io).boxed_unsync() | ||
| })); | ||
| _ = io_result_tx.send((Some(io), rx)); | ||
| body.boxed_unsync() |
Contributor
There was a problem hiding this comment.
Is the boxed_unsync call still serving a purpose here?
Contributor
Author
There was a problem hiding this comment.
This one could also be removed.
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.
Addresses #14112.
Instead of adding a new test, we modify existing tests which were just checking the response error to now check the transmission error.
As a drive by change, this also removes
BodyWithStatewhich seems to be unused.