Repository navigation
Conversation
Coverage
|
yas-run#90) * Expect TIMEOUT from a terminal command wait nothing started Since yas-run#54 a command wait that runs out before any command it could report on has started answers TIMEOUT (NOT_FOUND stays for an exited terminal or an evicted index). The client_host test still expected NOT_FOUND, so it failed on main. * Say what a terminal command wait answers when no command started Since yas-run#54 the server answers TIMEOUT when a command wait runs out before any command it could report on has started; wait_terminal_command's documentation still said NOT_FOUND, which stays for an evicted index or an exited terminal. * Capture a surface at the revision its caller listed, in one round trip capture_surface looks the window's revision up (a WATCH snapshot) before CAPTURE: two round trips, three for a caller that listed the windows first to choose one, as Ultimator's screenshots do. capture_surface_at(id, revision, format) sends CAPTURE with the revision the caller has; when the window changed since, the server answers STALE and it looks the window up again and captures that, as capture_surface does.
* Expect TIMEOUT from a terminal command wait nothing started Since yas-run#54 a command wait that runs out before any command it could report on has started answers TIMEOUT (NOT_FOUND stays for an exited terminal or an evicted index). The client_host test still expected NOT_FOUND, so it failed on main. * Say what a terminal command wait answers when no command started Since yas-run#54 the server answers TIMEOUT when a command wait runs out before any command it could report on has started; wait_terminal_command's documentation still said NOT_FOUND, which stays for an evicted index or an exited terminal. * Write small files in place in one APPLY round trip APPLY WRITE_INLINE items take item flag APPLY_ITEM_IN_PLACE (2), offered with CAPABILITY_APPLY_IN_PLACE (32): the item writes as COMMIT of a STAGE_IN_PLACE stage does (open with create and truncate through a final symlink, no temporary, no rename), through one shared write_in_place. An in-place write onto a directory is CONFLICT with {EISDIR, open} in the item's ApplyOsErrors entry, as COMMIT's. The flag is INVALID on other item kinds and with APPLY_ITEM_CREATE_PARENTS; APPLY_ITEM_EXTENDED_FLAGS lists it beside the v1 baseline's APPLY_ITEM_FLAGS. yas-client's write_in_place sends it for content within the server's inline limit and stages the rest, so a write tool call that already spends a round trip resolving or reading the file takes two in all, not three. TypeScript codec parity (inPlace) and golden vector fs.apply.in_place.payload. * Allow InPlace::mode unread on Windows; wrap the capabilities paragraph Review of yas-run#89: the mode an in-place write gives a file it creates is read under cfg(unix) alone, so Windows' -D warnings build failed on dead_code (Stage::mode had atomic_replace to read it). Windows files take their directory's ACL; say so on the field. Rewrap yas.md's opt-in paragraph at 80 columns.
…un#85) * Expect TIMEOUT from a terminal command wait nothing started Since yas-run#54 a command wait that runs out before any command it could report on has started answers TIMEOUT (NOT_FOUND stays for an exited terminal or an evicted index). The client_host test still expected NOT_FOUND, so it failed on main. * Say what a terminal command wait answers when no command started Since yas-run#54 the server answers TIMEOUT when a command wait runs out before any command it could report on has started; wait_terminal_command's documentation still said NOT_FOUND, which stays for an evicted index or an exited terminal. * Pace process output by its owner; drop a lagging watcher alone A command that wrote faster than its spawning session read lost its output and wedged that session's Process endpoint: - output_reader read each pipe with no backpressure, so once the owner's binding was 1 MiB (or 1024 frames) behind, it was evicted like any watcher. Its ACKs then found no binding, the stdout Transfer was reset NOT_FOUND "process not found", and the exit never came. - The eviction kicked the whole endpoint: route_outbound closed the session and returned, dropping the endpoint's event receiver. The session still accepted SPAWNs, but no later process on it ever reported output or an exit. Now the owner paces the child: before each read, output_reader waits until the owner's binding has a frame of room in its window (and at most 32 unacknowledged frames), and reserves its queue slot, so the owner is never evicted and a fast writer blocks on its pipe. Watchers of other sessions are still dropped when they fall a window behind, but alone: the endpoint reports evicted process IDs, their routes fail, and their attachments reset their Transfers RESOURCE_EXHAUSTED. A full route queue fails that route rather than the session, output for a route that already left is dropped, and a WAIT whose route left looks again instead of failing. close_session keeps its error (send_replace: nobody subscribes to it). Server-only; clients are unchanged. * Keep a paced owner's output past the exit; free an evicted watcher's slot Review of yas-run#85 (four paths it left): - An evicted watcher's binding left its endpoint slot behind, so a session that kept watching ran out of its 16 process slots. The eviction now frees the slot. - Detach answered Conflict once the child had exited, while its output could still be draining. A route that failed then (its queue full) left a binding whose exit found no route and closed the session; an owner that dropped its stream then left a binding nobody acknowledged, and its WAIT answered Conflict. Detach now goes through until the exit is queued, and an exit for a route that already failed is dropped rather than closing the session. - Once the child exited, the cleanup stopped waiting for its streams after the kill grace (or a LEAVE_RESIDUE grace), and dropped what the pipe still held for an owner slow to take its window: a slow link, or a client that waits for the exit first. With nothing of the group left, the readers the owner paces now go on until the pipes close, however slowly it takes them; the cleanup stops waiting only when no reader has waited for the owner for 250 ms (a holder outside the group, nothing coming) or a stream has given 1 MiB more (such a holder writing on). The graces still bound the group's residue. Each has a test in yas_process::tests that fails without the change (from the review's probes), plus one that a residue writing on still ends its grace though the owner reads nothing. * Say what a WAIT answers when its route failed as the exit was queued
* Expect TIMEOUT from a terminal command wait nothing started Since yas-run#54 a command wait that runs out before any command it could report on has started answers TIMEOUT (NOT_FOUND stays for an exited terminal or an evicted index). The client_host test still expected NOT_FOUND, so it failed on main. * Say what a terminal command wait answers when no command started Since yas-run#54 the server answers TIMEOUT when a command wait runs out before any command it could report on has started; wait_terminal_command's documentation still said NOT_FOUND, which stays for an evicted index or an exited terminal.
A SPAWN with the new opt-in flag REPORT_EXIT (16) gets its process's exit as an EXIT Event (Process 0x0002, sensitive) once it is final: the record a WAIT would return then. A command's SPAWN Result, output and exit thus all come from one request, where a client had to send WAIT and wait a round trip more. - Servers advertise it in a new optional family limit, LAUNCHER_FLAGS_EXTENDED (tag 19), since clients from before accept at most 12 in tag 11; a client sets REPORT_EXIT only when tag 19 offers it, so either side may be older. - The report takes none of the session's pending WAITs, is sent once (a SPAWN retried under its operation ID shares it), and outlives the streams: when the spawning session's attachment goes before the exit (its streams dropped, their route failed), the server waits for the exit itself and still sends it. - The streams go on at the pace of their credit, so the EXIT may arrive before their last bytes and CLOSE. - yas-client sets the flag whenever offered; Process::wait/wait_timeout then take no request and keep the reported exit. Attached processes, and servers without the flag, still WAIT. Tests (client_host): a_spawned_process_reports_its_exit_without_a_wait (with the only WAIT held, a non-zero exit with stderr, output beyond the stream buffer read while the exit is awaited, a signal, and another session's attachment that still WAITs), and a_server_from_before_report_exit_is_waited_for (ignored; YAS_OLD_SERVER=<yas without the flag>).
Review of yas-run#86: the server's fallback wait, for a REPORT_EXIT process whose attachment went before its exit, bound the process again (a detached one's slot was taken back and ATTACH answered CONFLICT), hung Process::wait when that wait failed, and an attachment aborted mid-send lost the EXIT. The fallback is gone: the attachment reports the exit, from a task of its own so removing the attachment meanwhile cannot cut the EXIT short. When the attachment goes first (a Transfer RESET on any of its streams, stdin included, sent or received, or a DETACH) no EXIT comes, and yas-client knows: its router marks the process's report lost, and Process::wait and wait_timeout then WAIT, after taking an EXIT that already arrived.
LAUNCHER_FLAGS_EXTENDED's hard maximum was 28, the flags it carries today: a later server adding one would have failed the HELLO of every client from this PR, as tag 11's maximum of 12 would have failed older clients for REPORT_EXIT. Its hard maximum is now 65535 (any u16 of SPAWN flags) and Limits::from_extensions keeps only the flags it knows, so the next flag needs no new tag.
pcarrier
force-pushed
the
spawn-exit
branch
from
September 30, 2026 09:17
958f763 to
29cd072
Compare
Author
|
Upstream PR merged into yas-run/yas main (now dd33f04): this CI-only draft is done. |
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.
Fork CI for yas-run#86 (yas-run's Actions are stuck org-wide). Do not merge.