docs: flybus README and bus conformance rows for sealing sends (BUS-02)
This commit is contained in:
parent
0a35b393aa
commit
6bc447a5bd
2 changed files with 25 additions and 1 deletions
|
|
@ -187,6 +187,7 @@ and once over a Unix socket, so `tests/rpc.rs::request_reply_roundtrip` means
|
|||
| The first backend is runtime-configured local files, optionally on tmpfs | conforms | `store.rs::Store::create` under `RouterConfig::store_root` | `store.rs::tests::orphans_are_removed_and_live_stores_kept` |
|
||||
| The producer writes staging storage outside the message stream | conforms | `store.rs::create_staging`, `client/mod.rs::Artifacts::allocate` | `tests/artifacts.rs::allocate_write_seal_read` (both) |
|
||||
| Seal closes writable handles in the SDK, checks length and digest, then finishes an immutable store-owned object before acknowledging | conforms: a writable descriptor kept after sealing reaches only the unlinked staging inode | `client/handles.rs::seal_with_digest` (drops the file first), `store.rs::seal` (fresh 0444 inode) | `tests/artifacts.rs::seal_is_immune_to_live_writable_handles` (both), `tests/conformance_artifacts.rs::seal_is_immutable_despite_a_stale_writable_handle` (both) |
|
||||
| Sealing on send (amendment 2026-10-02, BUS-02): an `rpc.call`/`rpc.reply`/`publish` attachment naming the sender's own writer is sealed (its declared prefix, copied outside the state lock) before the command is admitted, the writer becomes the sender's hold, `recycle` reissues the staging file as a new writer, and a refused sealing send releases every writer it named | conforms | `router/state.rs::{sealing_attachments, finish_sealing_send}`, `router/mod.rs::read_loop` (`SealThenAdmit`), `store.rs::{seal_prefix, rename}`, `client/handles.rs::{ArtifactWriter::into_unsealed, Responder::reply_sealing}` | `tests/sealing.rs::{a_reply_seals_and_recycles_its_writers, a_refused_sealing_send_releases_its_writers}` (both), `tests/artifacts.rs::unsealed_artifacts_cannot_be_used` (both) |
|
||||
| A copy into a fresh sealed inode is allowed; account for both allocations during sealing | conforms | `router/state.rs::op_seal` (`store_bytes += len` for the copy, released in `finish_seal`) | `tests/artifacts.rs::quotas_are_enforced` (both) |
|
||||
| No per-frame fsync for transient media | conforms by absence | `store.rs` | `tests/perf.rs` (seal p50 1.3 ms for 1.2 MB) |
|
||||
| Consumers resolve a readLocation through `artifact.open` and read it read-only | conforms; amended 2026-10-01 (bus-v1 section 12, BUS-01): a delivered handle uses the location its delivery carries, every other handle still asks | `router/state.rs::op_open`, `store.rs::open_read` | `tests/conformance_artifacts.rs::allocate_write_seal_open_roundtrip_and_mismatches` (both) |
|
||||
|
|
@ -345,7 +346,7 @@ behind "latest replaces only queued messages": the replacement never turns into
|
|||
|
||||
## The crate README's differences from the draft
|
||||
|
||||
Each of the ten differences the crate lists, kept with the sentence that allows it or fixed.
|
||||
Each of the differences the crate lists, kept with the sentence that allows it or fixed.
|
||||
|
||||
| README difference | Verdict |
|
||||
| --- | --- |
|
||||
|
|
@ -359,6 +360,8 @@ Each of the ten differences the crate lists, kept with the sentence that allows
|
|||
| 8. No `budget` argument on calls, and no router executable | Kept. Section 1 calls the executable "optional"; section 6 puts the deadline in the calling client, and the section 2 sketch no longer shows a budget either (amendment, contradiction 2) |
|
||||
| 9. Wire strictness: unknown fields in management bodies refused, `minor` must be 0 after hello | Kept. Stricter than section 4's "unknown envelope fields", forbidden nowhere, and section 4's envelope literally fixes `minor: 0` |
|
||||
| 10. `rpc.responder.release` and its terminal `call.failed` | Kept. Section 4 allows draft schema changes ("Changes to these draft schemas change contractDigest"), and it is how section 6's "bounded call correlation metadata" stays bounded when a handler outlives its request delivery. Added to the bus-v1 amendment (section 12) |
|
||||
| 11. Read locations in deliveries | Kept. The bus-v1 amendment of 2026-10-01 (BUS-01) |
|
||||
| 12. Sealing sends, `recycle`, and no `rpc.responder.release` after an admitted reply | Kept. The bus-v1 amendment of 2026-10-02 (BUS-02); section 8.1's immutability holds because the sealed bytes are still a copy, and a reply the router admitted already ended the reply authority the release would give up |
|
||||
|
||||
## Measured on the dev VM
|
||||
|
||||
|
|
|
|||
|
|
@ -186,6 +186,14 @@ let kept = frame.retain().await?; // an independent explicit hold
|
|||
- Sealing copies staging into a fresh read-only (0444) file and unlinks staging. A descriptor
|
||||
the producer kept or duplicated afterwards writes only to the unlinked staging inode. Sealing
|
||||
therefore needs quota for both copies while it runs.
|
||||
- **Sealing sends** (bus-v1 section 12, amendment 2026-10-02). `writer.into_unsealed()` ends
|
||||
writing and returns an `Unsealed` whose `artifact()` is the handle the sealed artifact will have
|
||||
(its first `written()` bytes, on the hold the writer becomes). Attach that handle to
|
||||
`responder.reply_sealing(outcome, attachments, unsealed, recycle)`: the router seals it as it
|
||||
admits the reply, with no `artifact.seal` round trip, and with `recycle` hands each staging
|
||||
allocation back as a fresh writer (`SealedReply::writers`), with no `artifact.allocate` either.
|
||||
The handle is valid once the reply is admitted. The router accepts sealing attachments on
|
||||
`rpc.call` and `publish` too; the SDK exposes them for replies.
|
||||
|
||||
### Errors
|
||||
|
||||
|
|
@ -332,6 +340,13 @@ before admission are `not-dispatched`. A command in flight when the connection i
|
|||
`rpc.request`, `rpc.result` or `topic.message` delivery carries `readLocation`, the location
|
||||
`artifact.open` would return under that delivery's ownership; a client attachment that carries
|
||||
one is refused as an unknown field. `wire::CONTRACT` (and so `contractDigest`) says so.
|
||||
12. **Sealing sends** (amendment 2026-10-02, BUS-02). An `rpc.call`, `rpc.reply` or `publish`
|
||||
attachment may name the sender's own unsealed writer (`ref.byteLength` at most its
|
||||
allocation, digest null); the router seals that prefix before admitting the command and the
|
||||
writer becomes the sender's hold. A body `recycle: true` reissues each sealed writer's
|
||||
staging file as a new writer, listed in the reply value's `writers`. A refused sealing send
|
||||
releases every writer it named. The SDK no longer sends `rpc.responder.release` after a
|
||||
reply the router admitted (it was a no-op). `wire::CONTRACT` says so.
|
||||
|
||||
## Limitations
|
||||
|
||||
|
|
@ -369,6 +384,8 @@ before admission are `not-dispatched`. A command in flight when the connection i
|
|||
cargo test -p flybus # unit + integration
|
||||
cargo test --release -p flybus --test perf -- --ignored --nocapture # the measurement above
|
||||
cargo run -p flybus --example demo # counter RPC, observer, held frame
|
||||
cargo run --release -p flybus --example rtt -- --spawned [--reply-artifact 92160 --read --sealing]
|
||||
# one RPC round trip's latency
|
||||
```
|
||||
|
||||
Every integration test runs twice, once over the in-memory transport and once over a Unix
|
||||
|
|
@ -391,6 +408,10 @@ socket, through the same router code:
|
|||
fan-out and collected after the last consumer; extracted artifacts and holds; atomic
|
||||
admission; release watermarks; connection-scoped owners; abandoned futures; disconnects; and
|
||||
router restarts.
|
||||
- `tests/sealing.rs`: sealing sends (amendment 2026-10-02): a reply that seals a writer's
|
||||
written prefix and recycles its allocation three times over one staging file, the caller's
|
||||
and the responder's handles reading the same bytes; refusals before and after the seal that
|
||||
release every writer named; `recycle` validation; a recycled writer sealing normally.
|
||||
- `tests/integration.rs`: two agents called in parallel with a forwarded frame, an environment
|
||||
service, committed snapshot publication, a slow latest consumer and a bounded recorder.
|
||||
- `tests/bus_acceptance.rs`: the implementation guide's BUS-01/02/03 acceptance bullets that the
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue