Skip to content

P3 service chaining#3591

Merged
itowlson merged 3 commits into
mainfrom
p3-service-chaining
Jul 13, 2026
Merged

P3 service chaining#3591
itowlson merged 3 commits into
mainfrom
p3-service-chaining

Conversation

@lann

@lann lann commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Fixes #3586

@lann
lann requested review from Copilot, dicej and itowlson and removed request for itowlson June 25, 2026 20:02
@lann
lann requested a review from itowlson June 25, 2026 20:03

This comment was marked as outdated.

This comment was marked as low quality.

@itowlson itowlson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It would be great to add a test - Rajat had one in his branch I think, or based on the existing service chaining tests. (But we can retrofit that if you need to get back to other priorities.)

@lann
lann force-pushed the p3-service-chaining branch from bd0c76b to 1ed6d2f Compare June 25, 2026 20:12
Comment on lines -691 to -700
/// An HTTP executor.
pub(crate) trait HttpExecutor {
fn execute<F: RuntimeFactors>(
&self,
instance_builder: TriggerInstanceBuilder<F>,
route_match: &RouteMatch<'_, '_>,
req: Request<Body>,
client_addr: SocketAddr,
) -> impl Future<Output = anyhow::Result<Response<Body>>>;
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by refactor removing this useless trait but it was difficult to extract from the rest of the work.

@lann

lann commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

This one is still a draft because I haven't tested it at all.

@itowlson

itowlson commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Okay I added tests, the one @rajatjindal wrote for P3-P2 chaining and a new one for P3-P3 chaining.

But unfortunately this has been lurking long enough to be overtaken by Joel's P3 update, and I don't understand his changes well enough to resolve the conflicts. @lann or @dicej could one of you see if you can rebase it successfully please? Thanks!

@itowlson
itowlson marked this pull request as ready for review July 9, 2026 00:14
@itowlson
itowlson force-pushed the p3-service-chaining branch from c42ef1e to 2443c86 Compare July 9, 2026 04:15
@itowlson

itowlson commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Okay I think I wriggled my way through the rebase. It seems to work but it did touch some stuff that I don't understand well. So if folks could give it an extremely suspicious review then I would be very grateful.

If I have mucked things up and we need to revert, the original working Lann code from before the rebase is at https://github.com/itowlson/spin/tree/p3-service-chaining-before-rebase.

@dicej dicej left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!


wit_bindgen::generate!({
path: "../../../../wit",
world: "wasi:http/service@0.3.0-rc-2026-03-15",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: consider using wasi:http/service@0.3.0 here and in internal-http-p3-front. No need to use the RC for new code except where we're specifically testing that the RC still works.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch - unfortunately that needs the WITs which are happening separately in #3603. So I'll merge this as is, and fix up in #3603 with all the other RC->P3 bits.

@itowlson

Copy link
Copy Markdown
Collaborator

Oh no I won't because the HTTP trigger has conflicts again WHEE

@itowlson
itowlson force-pushed the p3-service-chaining branch from 2443c86 to 5fb767a Compare July 12, 2026 22:47
@itowlson
itowlson merged commit 87aa59d into main Jul 13, 2026
17 checks passed
@lann

lann commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @itowlson

@lann
lann deleted the p3-service-chaining branch July 13, 2026 13:17
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.

Service chaining (*.spin.internal) doesn't work with WASI 0.3 handler

4 participants