Repository navigation
fix(minimal): min box events --parent --follow adds the stream of a child that is created after the - #3391
Conversation
Under --parent --follow, min lists the parent's children again each second and adds the stream of each new child to the follow. The follow ends when every followed box and the parent are removed. A parent with no child yet is followed too, in place of the no-children note.
…ents-parent-follow-adds-the-stream-of
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Approved: no findings at Nothing to do. Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it. Clobber: none seen in |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms to the design. Line 504 of architecture.md says min box events --parent self --follow merges all children into one stream. The follow now finds a new child each second and adds its replay-then-tail read to the merge, so no event is lost (line 502). The follow ends only when the parent is removed and every reader ended. Children of an exited parent therefore stay followed. The interim for issue 3024 is removed because the fix lands.
Ruled at 12ef362 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
…ents-parent-follow-adds-the-stream-of
A new child that each listing shows but whose events read fails to open ends the follow with the open error after five tries, in place of a silent gap.
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
A box that becomes a child of the parent after Notes from the agent: Revise round 1: ChildWatch counts failed opens per new child. After 5 listings in a row that show the child and fail to open it, the follow ends with the existing open error ("Could not read the events of box . Run |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The compare adds one change. A new child whose events read fails to open at five polls in a row now ends the follow with the open error. Before, the merged stream left out that child silently. Lines 502 and 504 of architecture.md say the follow merges all children and misses nothing. This change keeps the follow closer to that. The earlier PASS on 12ef3626 stands for the rest of the PR.
Ruled at 210b609 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
A failed re-list of the parent's children no longer ends the follow at once. Five failed listings in a row end it with the list error.
…ents-parent-follow-adds-the-stream-of
|
Round 2 of 10 on the runtime's review findings, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
A box that becomes a child of the parent after Notes from the agent: Revise round 2: a failed re-list of the children now keeps the follow. Five failed listings in a row (CHILD_LIST_TRIES) end it with the same error text as before. A successful listing rese 8BD0 ts the count. No new test pins the retry bound. cargo clippy -p minimal --all-targets is clean. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The compare conforms, and the PASS on 210b6094 stands. Commit 1cab2c0e keeps --parent --follow open through four failed listings of the children. The fifth failure in a row ends the command with the same error. Line 502 says --follow replays, so a child found after the outage loses no events. Nothing more is necessary.
Ruled at 14e31d6 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 2 unresolved threads — minimal-foundry[bot] crates/minimal/src/cmd/boxes/events.rs:349, minimal-foundry[bot] crates/minimal/src/cmd/boxes/events.rs. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
There was a problem hiding this comment.
Read at 14e31d6 against #3346, the daemon's events channel and the client's reader. The main change is
right: a new child is found by listing the host once a second (one manager message, no disk walk) and
joins the follow with a replay-then-tail read, so no event is lost; plain --follow without --parent is
untouched (no watch, the poll branch disabled). Two things before it merges, both in the code the last two
commits added:
- A child removed right after a listing ends the whole follow. The daemon answers the subsystem request
before it reads anything about the box (crates/minimald/src/rpc.rs:3630, handed to the events handler at
3717), and looks the id up only inside the stream (rpc.rs:2490-2497); an unknown id is written as extended
data and the channel closed (2481). The client'sread_box_events(crates/minimal-client/src/lib.rs:1129
via 1103 and 1058) returns Ok on the channel's success message and never waits for a first line, so for a
child that is already gone the open succeeds. The refusal then arrives in the line reader (lib.rs:1387),
becomes "Could not read the events of box X" (events.rs:393), travels through the merge channel and the
next?at events.rs:493 ends the command, parent and other children healthy. So the retry at
events.rs:331-350 and its comment ("a failed open is tried again") cover only a channel refused outright or
a dropped connection; the case the comment names never reaches the counter. A reader the watch added should
treat a refusal before its first event as "not opened yet": retry it, or drop it if the next listing no
longer shows the child (or read the first line innew_childrenbefore adding the reader). Then test it. - Discovery runs inside the output loop, so a slow list stops all output (events.rs:500). A ListBoxes that
hangs behind a busy manager waits up to the 60 s RPC timeout per try, and healthy streams print nothing
meanwhile; the "short outage" allowance is about four seconds when calls fail fast and about five minutes of
silence when they time out. The open has no timeout at all, so one wedged open freezes the follow. Run
discovery in its own task that sends new reads over a channel, with a short timeout on both the list and
the open.
Also, the second and third commits (stop on a child that never opens; survive a short list outage) have no
test: nothing drives the five-try bounds, the reset after a success, or the ending when the parent is
removed, and the existing test cancels the follow rather than letting it stop. One test per behaviour.
Smaller, no ask: finished readers stay in the JoinSet and the seen set only grows (events.rs:465), so a
parent that churns children grows without bound; collect finished readers on each poll. A parent with no
children prints "has no child boxes" without --follow and nothing with it, which reads as a hang; one stderr
line ("no child boxes yet; waiting") would do. Once-a-second polling emits a daemon list span and an info
line per poll, about 86k of each per day per follower; debug level for this path. A child created just
before the parent is removed is never added, since the watch returns before scanning the last listing
(events.rs:324); fine, but say so in the docs.
Checked and fine: every error return drops the reader set, which aborts the readers; when the parent is
removed the watch and sender drop and the loop ends after the last reader; each child is opened once and a
reaped child never reopened; a joining child replays by arrival, as the initial children do; open-failure
counts leave when the box leaves the listing; Ctrl-C is unchanged. The commitlint check is red only on
merge-commit headlines, which a squash drops.
…ents-parent-follow-adds-the-stream-of
|
/revise Head 1. A refusal before a reader's first event is "not opened yet", not an error. Fix: a reader the watch added treats a refusal before its first event as not opened yet. Either retry it, or drop it when the next listing no longer shows the child. Alternatively, read the first line in 2. Discovery runs in its own task, with timeouts. 3. One test per behaviour of the second and third commits.
His "smaller, no ask" items are optional. If you take any, keep them small: reap finished readers each poll, print a one-line "no child boxes yet; waiting" on stderr, and log the per-poll lines at debug level. Reply on his review and on threads PRRT_kwDOPdfcxM63J7_f and PRRT_kwDOPdfcxM63K1ec with the commit. Run the whole |
|
That Nothing to type again: the command gets a rocket when its round starts, or a refusal that names the reason. No round was counted for it yet. |
Under `min box events --parent --follow`, the child watch now runs in its own task and sends new reads to the output loop. A slow listing or open no longer stops the output of the streams already in the follow. Each listing and each open has a 5 s timeout and counts as a failure after it. A new child whose read the daemon refuses before its first event is not in the follow yet. The next listing that shows it opens it again, and a child gone from the listing is dropped. Finished readers leave the set on each poll, and the seen set keeps only listed children. A follow of a parent with no child yet prints one line on stderr. Tests drive the retry, the drop, the open and list try bounds, a hung listing, and the end when the parent is removed.
…ents-parent-follow-adds-the-stream-of
|
Round 3 of 10 on a review requesting changes, pushed as
Verify Converted to a draft: something above needs a person before review. A box that becomes a child of the parent after Notes from the agent: Review round 3. (1) Refusal before the first event: the reader of a new child sends its first update back to the watch. An error there removes the child from the seen set and counts one failure. The next listing that shows the child opens it again. A child gone from the listing is dropped. After CHILD_OPEN_TRIES failures in a row while the child is still listed, the follow ends with the error. (2) Discovery now runs in its own task (watch_children). That task sends events and errors over the output channel. Each listing and each open has a 5 s timeout (CHILD_CALL_TIMEOUT), and a timeout counts as a failure. (3) There is now one test per behaviour, run on a paused clock against a fake host (ChildSource and EventLines traits): retry after a refusal, drop of a gone child, the open try bound, the list try bound with its reset after a working listing, output while a listing hangs, and the end when the parent is removed. Smaller points: finished readers leave the JoinSet on each poll, and the seen set keeps only the children the last listing showed. A follow of a parent with no child yet prints one stderr line: 'Box has no child boxes on host yet. The events of each new child box print here. Press Ctrl-C to stop.' No per-poll log line is left in events.rs on the healthy path. The info-level 'client.rpc' span in crates/minimal-client and the daemon's ListBoxes span still fire once per poll. Both are outside this task's layers (minimal-client/src/lib.rs, minimald/src/rpc.rs). The limit about a child created just before the parent is removed is documented in the rustdo…[truncated] |
Split the list outage test of `min box events --parent --follow` in two: one for the reset of the count after a listing works, one for the end after five failed listings in a row. Add a test for a new child whose read opens on its last try.
|
/revise Head
Also put a short timeout on the open and the list in the discovery task, if f25a2dc has none. Reply on Bryan's review with the commit. |
|
That Nothing to type again: the command gets a rocket when its round starts, or a refusal that names the reason. No round was counted for it yet. |
There was a problem hiding this comment.
Reviewed against D3024 at 7cde2e46. Under --parent --follow, ChildWatch lists the boxes again every CHILD_POLL (1 s) and opens a read for each new child of the parent, which joins the merged follow. A child gone from the listing is dropped. Both retry bounds from the LOW threads are in: CHILD_OPEN_TRIES (5 failed opens in a row of one child end the follow with that child's error) and CHILD_LIST_TRIES (5 failed listings in a row end it). A success resets each count, and every call is bounded by CHILD_CALL_TIMEOUT. events_parent_follow_picks_up_new_children proves the plan's claim, and the gone-child and never-opens cases are tested. Nit, no ask: after five failed listings the person sees a generic message; the underlying error is only in the warn log. Arch: PASS on head.
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of 7cde2e460e2f withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.
|
Round 4 of 10 on a /revise note, pushed as
Verify Converted to a draft: something above needs a person before review. If a box becomes a child of the parent after Notes from the agent: Revise round 4. Commit f25a2dc in the previous round already did asks 1 and 2. A refusal before the first event is now 'not opened yet': the read opens again, or the watch drops it when the listing no longer shows the child. Discovery runs in its own task with a 5 s timeout on each list and each open. Ask 3 was partly done. This round split the list outage test into events_parent_follow_resets_the_list_count_after_a_listing_works and events_parent_follow_stops_after_the_list_tries. It also added events_parent_follow_adds_a_child_that_opens_on_its_last_try. The five-try bound, the hung listing and the removed parent already had tests. No product code changed this round. I did not reply on the review or the threads because I have no gh credential. The runtime posts verdicts. Whole-suite runs: |
|
The runtime will not revise this pull request again on its own: the diff is +863/-45 (908 lines), past 3x the plan's estimate of 150 lines (est: 70 code, 80 tests, as #3346 reads now), at round 4 (the last trigger was a /revise note). A person decides now. Remove |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The compare from 7cde2e46 changes only tests. The new tests pin the list bound, the reset of the list count and the open bound that events.rs sets. No test relaxes a gate. The PASS on 7cde2e46 stands for the follow under architecture.md line 504.
Ruled at 3d4f76f against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
|
@bryan-minimal your three asks are in at 3d4f76f:
Could you re-review once CI is green? |
There was a problem hiding this comment.
Re-read at 3d4f76f0. The one commit since 7cde2e46 splits the outage test into three, one per try bound: a child that opens on its last try joins the follow, a working listing resets the failed-list count, and CHILD_LIST_TRIES failures in a row end the follow (one fewer does not). That is ask 3 of the review requesting changes; asks 1 and 2 are in events.rs (the refusal before a first event goes to the watch, discovery in its own task). Required CI is green; agent-verify fails only on #3398.
There was a problem hiding this comment.
I re-read the change at 3d4f76f, mainly the two new commits: the child watch in a task of its own, and the tests of the try bounds.
Both earlier requests are resolved. A new child's read that the daemon refuses before its first event now goes back to the watch, not to the output. The next listing opens it again if the child is still listed and drops it if it is gone. Open failures and early refusals share the five-try bound, and a first update that arrives clears it. Discovery runs in its own task, and the list and each open now have a 5 s timeout. A slow or hung listing no longer holds back the streams already in the follow, and the hung-listing test shows that. Each call runs on its own channel, so a timed-out call leaves nothing behind. Dropping the task set on any return stops the watch and every reader.
The tests now cover each bound by letting the follow stop on its own: five failed opens, five failed listings, a reset after a listing that works, a child that opens on its last try, a hung listing, and the end once the parent is removed. They run on paused time against a fake host, so I do not expect them to be timing-sensitive.
The smaller notes about readers and the seen set growing, and the stderr line for a parent with no children yet, are both taken. Thanks.
One thing left, not blocking: the children in the first listing still take the old path. They are spawned without the first-update channel, so a child removed between the startup listing and its first line ends the whole follow, the same way a new child did before. The window is short. Sending the initial children through the same first-update handling under --parent --follow would close it; a follow-up is fine.
Smaller still: polling logs at info level once a second, and the limit on a child created just before the parent is removed is only in a code comment. The watch task is never joined, so a panic in it would be silent; I found no panic site on that path. None of these needs to hold this up.
The commitlint check is red only on merge-commit headlines, which a squash drops.
|
A correction to my review above: the red commitlint check is not about merge-commit headlines. It is one commit, "fix(minimal): keep box events --follow through a short list outage", whose body has a line over 100 columns. The conclusion stands: commitlint is not a required check, and the squash keeps none of the commit bodies, so it does not need a fix before merge. |
Defect
Fixes #3346
crates/minimal/src/cmd/boxes/events.rscrates/minimal/src/tests.rsTask marker
Proof
When a box becomes a child of the parent after
min box events --parent <box> --followstarts, its events now appear in the output of that follow, within about one second.Notes from the agent: Under --parent --follow, min lists the boxes again every second (CHILD_POLL) and opens a follow read for each new child of the parent. A failed open for a new child is tried again at the next poll. The follow now ends only when every followed child has ended and the parent is gone from the listing. Before, it ended when every child at the start was removed. A failed re-list ends the command with this error: 'Could not find the new child boxes of box
. Runmin box show <address>to check that the box still exists.' Behaviour change: under --follow, a parent with no child yet is followed and prints nothing. The note 'Box has no child boxes on host .' is still printed without --follow. The interim comment that named issue 3024 is removed. The new test fails without the fix: it times out at the 30 s deadline. The other events_ tests pass, and clippy -p minimal --all-targets and fmt are clean.Tests
cargo test -p minimal events_parent_follow_picks_up_new_childrenVerify
min task run agent-verifyexited 100, so this PR is a draft.Base
The base branch moved while the coder worked; it was merged in before the tests ran.