rvolosatovs opened PR #11440 from rvolosatovs:feat/wasip3-http-impl to bytecodealliance:main:
This PR builds on top of #11221 and will contain the full implementation of
wasi:httpproposal with refcounting (no child resources). This will be made ready-for-review once all currently ignored tests pass
rvolosatovs edited PR #11440:
This PR builds on top of #11221 and will contain the full implementation of
wasi:httpproposal with refcounting (no child resources). This will be made ready-for-review once all currently ignored tests passhttps://github.com/bytecodealliance/wasmtime/pull/11440/commits/480558daacc00f95b594f332b9f1747d15e69f3f is currently the only commit here worth looking at
rvolosatovs updated PR #11440.
rvolosatovs edited PR #11440:
This PR builds on top of #11221 and will contain the full implementation of
wasi:httpproposal with refcounting (no child resources). This will be made ready-for-review once all currently ignored tests passhttps://github.com/bytecodealliance/wasmtime/pull/11440/commits/4819aade1167a937d6c00f6026eb5451d2f100e3 is currently the only commit here worth looking at
alexcrichton submitted PR review.
alexcrichton created PR review comment:
One suggestion perhaps for many of these methods is to have a generic extension trait which supports an arbitrary
TforResource<T>which could help deduplicate these methods?
alexcrichton created PR review comment:
Could this use
trappable_errorconfiguration to aovid the double-layer ofResult? That would also enable using?below to propagate errors.
rvolosatovs updated PR #11440.
rvolosatovs updated PR #11440.
rvolosatovs updated PR #11440.
rvolosatovs updated PR #11440.
rvolosatovs updated PR #11440.
rvolosatovs updated PR #11440.
rvolosatovs updated PR #11440.
rvolosatovs updated PR #11440.
rvolosatovs updated PR #11440.
rvolosatovs updated PR #11440.
rvolosatovs updated PR #11440.
rvolosatovs updated PR #11440.
rvolosatovs commented on PR #11440:
I'm done for the week and will continue on Monday, but this is pretty close to having all test cases passing.
@alexcrichton @dicej feel free to make the necessary changes in the PR to make the rest of the test cases work if there's a desire to still finish
wasi:httpthis week.
Alternatively, merging this PR as-is and addressing the rest in follow-ups would work as well.
rvolosatovs edited a comment on PR #11440:
I'm done for the week and will continue on Monday, but this is pretty close to having all test cases passing.
@alexcrichton @dicej feel free to make the necessary changes in the PR to make the rest of the test cases work if there's a desire to still finish
wasi:httpthis week.
Alternatively, merging this PR as-is and addressing the rest in follow-ups would work as well.If we're okay with waiting until next week, this should be complete by Monday evening
rvolosatovs edited a comment on PR #11440:
I'm done for the week and will continue on Monday, but this is pretty close to having all test cases passing.
@alexcrichton @dicej feel free to make the necessary changes in the PR to make the rest of the test cases work and get this over the line if there's a desire to still finish
wasi:httpthis week.
Alternatively, merging this PR as-is and addressing the rest in follow-ups would work as well.If we're okay with waiting until next week, this should be complete by Monday evening
alexcrichton updated PR #11440.
alexcrichton created PR review comment:
Debugging this: in my opinion the bug is that dropping a
requestresource does not properly close its stream handles. That's not currently possible, however, because duringdropthere's no access to the store. I made https://github.com/bytecodealliance/wasmtime/pull/11628 to fix this.
alexcrichton created PR review comment:
Could you comment this function to the purpose of
fut?
alexcrichton created PR review comment:
I've debugged these three ignores and it's due to this code needing to happen concurrently with
handler::handlenow instead of synchronously after. It's easy enough to lift thatasyncblock to thejoin!above except then it runs into the panic described in https://github.com/bytecodealliance/wasmtime/issues/11621 so these will have to wait for that to get fixed
alexcrichton created PR review comment:
Could this and
getget removed in favor of theDerefimpl?
alexcrichton created PR review comment:
Mind expanding the docs here to explain what this is used for? For example how headers are immutable when read from some locations but mutable in others. Regardless everything uses an
Arcand exhibits copy-on-write behavior.
alexcrichton created PR review comment:
This may be preexisting with wasip2 as well, but I'm having a tough time piecing together what's going on here. Mind leaving some comments to what this is doing?
alexcrichton created PR review comment:
Could this use a
TrappableErrorfrom thewasmtime_wasicrate like filesystem & sockets?
alexcrichton created PR review comment:
This is one of the reasons I'm seeking more documentation on the various future parameters. This and below looks to be a very careful and particular dance with respect to various errors but I'm not really sure what's going on here in the abstract. I would hope that we can figure out a way to simplify this, but in lieu of that I'm hoping for more docs as to what's going on.
alexcrichton created PR review comment:
Is this
HttpResult::Ok(( ... ))?still needed? (vs just "do the thing")
alexcrichton created PR review comment:
Could you expand the documentation here to include what the various layers of futures are and what their meaning is?
alexcrichton created PR review comment:
Technically this is a slightly dangerous
?(and everything below before the body is consumed) because if the body is a guest body the resources won't get properly closed.Would it make sense to lift the body construction all the way to the top here so that happens first?
alexcrichton created PR review comment:
Mind adding a small doc block here explaining what this is doing? The code is pretty self-explanatory but I still think it'd be good to have an intro
alexcrichton submitted PR review:
Ok I've gone over this and it looks good to me, thanks again @rvolosatovs!
I've left a bunch of comments below which I'd like to resolve at some point, but doesn't need to block. I'm going to flag this for merge and I'll file follow-ups.
alexcrichton created PR review comment:
If you'd like you can drop the
for<'a>here and useWasiHttpCtxView<'_>at the end
alexcrichton created PR review comment:
I realize this is probably copied from wasip2, but could this
log::warn!the error that's discarded here?
alexcrichton created PR review comment:
Is it possible to share this with
Request::consume_bodysince it's more-or-less the same function?
alexcrichton created PR review comment:
Mind leaving some comments here (and in
is_end_stream) about the state machine being managed here? Doesn't need to be too wordy but having headings to grasp on I think would be helpful
alexcrichton created PR review comment:
Like response below, could you comment this returned future here and with
new?
alexcrichton created PR review comment:
Mind leaving some small comments in this function body to help navigate what the state machine is doing? (e.g. a ocmment explaining the signficance of each arm here and there)
alexcrichton created PR review comment:
Could you comment function as to what this future is?
alexcrichton has marked PR #11440 as ready for review.
alexcrichton requested wasmtime-wasi-reviewers for a review on PR #11440.
alexcrichton requested dicej for a review on PR #11440.
alexcrichton requested wasmtime-core-reviewers for a review on PR #11440.
alexcrichton requested wasmtime-default-reviewers for a review on PR #11440.
alexcrichton has enabled auto merge for PR #11440.
rvolosatovs submitted PR review.
rvolosatovs created PR review comment:
There's currently no
Content-Lengthheader handling, so I would not modify this test until that's implemented in the host.
alexcrichton updated PR #11440.
alexcrichton has enabled auto merge for PR #11440.
alexcrichton merged PR #11440.
rvolosatovs submitted PR review.
rvolosatovs created PR review comment:
I forgot to port the test response streaming, which I've done in wasip3-prototyping precisely to fix this. I think it's useful to specifically test the fact that
handlereturns before response body are streamed, so I'd rather not rearrange thejoin!.This is fixed in https://github.com/bytecodealliance/wasmtime/pull/11636
rvolosatovs created PR review comment:
Exactly, I've used the feature you've added to fix it in https://github.com/bytecodealliance/wasmtime/pull/11636
rvolosatovs submitted PR review.
rvolosatovs created PR review comment:
I'm not sure that's a good idea for this particular one, since that would require exposing the
HttpErrorto embedders and they'd need to handle thetrapcase themselves.While this signature is definitely not ideal, IMO it's clearer and it aligns with what
call_handlewould otherwise return if called directly
rvolosatovs submitted PR review.
rvolosatovs assigned rvolosatovs to PR #11440.
Last updated: Dec 06 2025 at 07:03 UTC