Commit 96707a5
Document concurrent instance reuse in
* Document concurrent instance reuse in `wasi:http/service`
This commit adds a documentation block to the `wasi:http/service` world
that's the result of discussions in today's WASI subgroup meeting, #918,
and #919. The documentation here indicates a few properties around
concurrent instance reuse, namely:
* Guests should expect to be concurrently reused. If this is not
acceptable then guests should disable reuse through backpressure
mechanisms.
* Guests should ensure that outgoing HTTP requests are done within the
context of the original root task, or the original invocation of
`handler`. If guests can't implement this then they're expected to use
backpressure mechanisms instead.
The overall conclusion of the various discussions that have happened
over the past week or so is that it's not possible to provide the
attribute behavior some hosts require exclusively through either
in-guest interactions or pure-host interactions. Instead being able to
reliably provide accurate attribution requires specifically outlining
guidelines for both guests and hosts. The mechanism intended to be used
for attribution is then:
* For hosts such as Wasmtime calls to imports will be able to reflect on
the current async call stack, notably the root export task. Hosts can
then use this to correlate an identifier provided when a root task is
created, providing a strong link from the import call to whatever
export initiated it. This is expected to work as-is for some guest
languages, such as Rust, but this is also not a bulletproof solution.
Guests can always internally call imports from any currently-running
task, and additionally languages such as JS and Go at this time are
structured in such a way where imports are not always naturally called
from the originating export task.
* To enable languages like JS and Go to be able to leverage concurrent
reuse while providing accurate attribution of outgoing requests to
incoming requests, the plan is to eventually add and specify
intrinsics on the component model level to, in a scoped fashion,
mutate the async call stack. For example a guest would be able to say
"I'm about to do some work for this component model task". When
Wasmtime reflects on the async call graph at that time it'd see this
and understand that the attribution needs to be slightly adjusted to
what it would otherwise by default be.
The goal with these addition is to enable hosts to be able to reliably
expect to attribute outgoing requests to incoming requests (via async
call graph inspection), provide guests the ability to work today (either
naturally or disabling concurrent reuse via backpressure), and ensure
that well-behaved and idiomatic guests can work reliably with concurrent
reuse in the long-run (via component model intrinsics to massage the
async backtrace that hosts operate with). When this is all combined it's
expected to resolve the concerns of #918 and #919 with idiomatic
bindings in guests and hosts alike.
Closes #918
Closes #919
* Review comments
* Apply suggestions from code review
Co-authored-by: Joel Dice <joel.dice@akamai.com>
* Update proposals/http/wit-0.3.0-draft/worlds.wit
Co-authored-by: Joel Dice <joel.dice@akamai.com>
* fix(http): depend on latest fs in dep lock
* fix(http): renormalize to LF
---------
Co-authored-by: Joel Dice <joel.dice@akamai.com>
Co-authored-by: Bailey Hayes <bailey@cosmonic.com>wasi:http/service (#920)1 parent 1fb48d1 commit 96707a5
3 files changed
Lines changed: 40 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
34 | 66 | | |
35 | 67 | | |
36 | 68 | | |
| |||
0 commit comments