Repository navigation
fix(bootstrap): [#2416] stop event producers before event listeners - #2623
josecelano merged 40 commits into
Conversation
…eners Closes loss window (b) of torrust#2410: events published after every listener of their bus had stopped were lost, because `cancel()` cancelled every component at once. - `JobManager::spawn_with` takes `StopBefore` edges. `cancel()` cancels the components that wait for nobody; `wait_for_all` cancels each of the others when the last component it waits for has completed (any outcome), and never before `cancel()`. The shared deadline still aborts and joins the rest. Registration rejects unknown, released, foreign, not-earlier ids and edges after `cancel()` without leaving state behind. - `EventFlows` and `Bus` in `src/bootstrap/event_flows.rs` turn per-bus declarations into edges and reject a consumer registered after a producer of its bus. `src/app.rs` declares the buses of the HTTP and UDP instances and of torrent cleanup. - The controlled late-publication test on the real swarm bus and the `JobManager` stop-order test were red against stored-but-not-enforced edges (evidence V1) and are green now (V2); a mutation per lifecycle clause is recorded (V3). - The extended application test keeps its assertions and gains the declared and completion order; it is renamed, no test was removed or merged. - New in-process test `persistence-completed-downloads-on-shutdown` and the `http_complete_download` test helper; ADR draft sections 3 and 4 and sub-EPIC record entry 31 describe the implemented API. Co-authored-by: Copilot <[email protected]>
…re the listeners in the test environments Each standalone test environment now has independent tokens and one `DropGuard` for its server and for its listeners (D20). `stop()` cancels and joins the server (and the HTTP drain controller), then cancels and joins the listeners, so the events of requests that complete while the server drains are processed. Failures are still reported only after every task was joined, and dropping an environment without `stop()` cancels both tokens. The listeners guard moves into the join function and is disarmed after the server stage, so an abandoned `stop()` cannot leave detached listeners (sub-EPIC record entry 32). The HTTP test keeps a `completed` announce in flight while `stop()` drains: red before (`left: 0, right: 1`), green after. A UDP request cannot be held in flight, so the UDP late-event test is regression coverage and the UDP order is guarded by a staged-join unit test. A mutation per clause is recorded in the torrust#2416 evidence (V4). Co-authored-by: Copilot <[email protected]>
…de the cancellation-tree ADR Move the draft ADR from the sub-EPIC folder into `docs/adrs/` with a `create-adr` filename (D15), now that the stop order, the listener drain, and the test environments are implemented and verified. It restates every still-valid point of the cancellation-tree ADR, which gets `- Status: Superseded by` the new one. `docs/adrs/index.md` lists the new ADR; `JobManager` and `EventFlows` link it from their module docs; the draft is rewritten in the past tense where it described the code before the decision, and gains an Affected Code section. Bare mentions of `adr-draft.md` in closed specs and in earlier record entries are history and are not rewritten; no link pointed to the draft. Co-authored-by: Copilot <[email protected]>
…diagrams, and add the swarm bus - Move the five D16 diagrams to stable documents and update them to the final implementation: the event data flow to `events.md`, and the supervision tree, startup and shutdown sequences, and component boundary to `application-jobs.md`, which replaces its bootstrap diagram. The sub-EPIC record keeps links instead of copies. - `events.md` now describes the swarm bus, its producers (HTTP and UDP instances, torrent cleanup), and its three listeners, which it omitted (finding of torrust#2413 T1), and the start and stop rules. - Update the glossary (no planned entries remain), the task inventory (ordered shutdown, `EventFlows` declarations, the test environments' guards), the shutdown feature README, and the shutdown architecture examples (per-component tokens instead of a root-token cascade). Co-authored-by: Copilot <[email protected]>
… acceptance evidence Add the M1 to M3 rechecks on the real binary (the T0 control and race parameters, and the stop-order logs under a mixed HTTP and UDP burst), the automatic checks, the M1 harness and its configuration, and the acceptance-criteria evidence of the issue. The race runs are recorded as a recheck, not as the proof of window (b), which the controlled red and green tests are. The acceptance criteria are not ticked. Co-authored-by: Copilot <[email protected]>
…implementation retrospective Record the Task Reviewer report (no blocking finding) with its follow-ups, correct two stale test counts in the evidence, mark T3 to T5 `DONE` in the sub-EPIC plan (stale since torrust#2414 merged), and add the retrospective. Co-authored-by: Copilot <[email protected]>
…der in the create-adr skill The shutdown-order ADR was drafted in the sub-EPIC folder, updated with every agreed design change, and moved into `docs/adrs/` in the last pull request that changed the design (D15 of sub-EPIC torrust#2410). The maintainer approved documenting the process, which D15 asked this issue to propose. Co-authored-by: Copilot <[email protected]>
… both progress logs Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
Cross-component shutdown ordering, deadline escalation, and abandoned-shutdown cleanup warrant final maintainer validation of the lifecycle guarantees and recorded evidence.
No open issues 🎉
What changed in this PR
This PR implements producer-before-listener shutdown for #2416, completing the shutdown-order portion of sub-EPIC #2410. It extends the application supervisor so listeners remain active while their event producers finish.
Changes:
- Adds validated
StopBeforedependencies and derives shutdown order from event-bus declarations. - Stages HTTP and UDP test-environment shutdown, with lifecycle and persistence regression coverage.
- Promotes the shutdown-order ADR and updates architecture documentation, diagrams, and verification records.
| File | Description |
|---|---|
tests/persistence/completed_downloads_on_shutdown.rs |
Tests persistence of HTTP completions after shutdown. |
tests/common/mod.rs |
Exports the HTTP completion helper. |
src/bootstrap/mod.rs |
Exposes the event-flow module. |
src/bootstrap/jobs/manager.rs |
Enforces shutdown dependencies and tests lifecycle behavior. |
src/bootstrap/event_flows.rs |
Maps event buses to listener dependencies. |
src/app.rs |
Declares producer/listener relationships and tests wiring. |
packages/udp-server/src/testing/environment.rs |
Stops the UDP server before its listeners. |
packages/test-helpers/src/http.rs |
Adds started/completed announce sequencing. |
packages/axum-http-server/src/testing/environment.rs |
Stops HTTP server tasks before the statistics listener. |
docs/issues/open/2416-2410-si-22-4-stop-producers-before-listeners/manual-verification-evidence.md |
Records regression, mutation, and runtime evidence. |
docs/issues/open/2416-2410-si-22-4-stop-producers-before-listeners/ISSUE.md |
Updates implementation progress and acceptance evidence. |
docs/issues/open/2416-2410-si-22-4-stop-producers-before-listeners/implementation-retrospective.md |
Records implementation lessons and limitations. |
docs/issues/open/2416-2410-si-22-4-stop-producers-before-listeners/evidence/run_m1.py |
Provides the mixed-protocol shutdown verification harness. |
docs/issues/open/2416-2410-si-22-4-stop-producers-before-listeners/evidence/m1-tracker.toml |
Configures the mixed-protocol verification tracker. |
docs/issues/open/2416-2410-si-22-4-stop-producers-before-listeners/agent-review-reports.md |
Records independent review results and follow-up actions. |
docs/issues/open/2410-1488-si-22-process-queued-events-before-listeners-stop/EPIC.md |
Updates design decisions, progress, and diagram references. |
docs/features/shutdown-process/task-inventory.md |
Documents ordered shutdown and token ownership. |
docs/features/shutdown-process/shutdown-architecture-examples.md |
Updates cancellation examples for independent tokens. |
docs/features/shutdown-process/README.md |
Summarizes ordered cancellation and links the new ADR. |
docs/architecture/glossary.md |
Aligns lifecycle terminology with the implementation. |
docs/architecture/events.md |
Documents the swarm bus and event-flow shutdown rules. |
docs/architecture/application-jobs.md |
Documents supervision, startup, and shutdown sequences. |
docs/adrs/index.md |
Registers the new ADR and marks supersession. |
docs/adrs/20261021184946_order_shutdown_by_event_flow_and_drain_event_listeners.md |
Promotes and finalizes the shutdown-order decision. |
docs/adrs/20260902074438_adopt_supervised_cancellation_tree_for_shutdown.md |
Marks the cancellation-tree ADR as superseded. |
Cargo.toml |
Registers the shutdown-persistence integration test. |
.github/skills/dev/planning/create-adr/SKILL.md |
Documents drafting and promoting issue-local ADRs. |
Review effort: Balanced
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at d42a357fa2ad05fa04a59cd19005e854b7e9939c. Recomputed from the bytes at this head, against the merge base a843009af (the merge of #2615); git merge-tree against develop 29e1f7ce3 is clean (exit 0, no conflict), and the 22 commits develop gained touch none of the 27 files this PR changes (+3,127/−489 against the base).
Job manager. Component tokens are independent CancellationToken::new() values, so the legacy root token that cancel() cancels reaches no component. request_shutdown cancels exactly the components with no unfinished predecessor, records the others in ShutdownPlan with what each waits for, and returns None the second time. mark_finished runs at the join for every outcome (completed, cancelled, failed, panicked) and cancels a successor only when its set empties, after cancel(), and if it has not finished. add_stop_before checks every target (manager id or missing entry gives UnknownStopBeforeTarget, so a foreign id is never ordered; target >= id, which covers a self edge, gives StopBeforeTargetNotEarlier), then the cancelled flag, before any insert; on rejection the guard drops before the reservation, whose drop releases it, and the runner is never spawned. Nothing awaits under the registry lock. At the deadline the never-released consumers are logged with waiting_for and aborted.
Event flows and bootstrap. consumers_of marks its buses as produced at declaration; add_consumer then refuses a consumer of such a bus through app::Error::EventFlows, an error path (no panic) that start_jobs turns into cancel, wait and a startup failure; the registration order of start_jobs_with_manager never triggers it. Every publishing component is declared: the UDP instance on udp-core, udp-server and swarm, the HTTP instance on http-core and swarm, torrent cleanup on swarm; the activity updater, ban cleanup and the two APIs publish nothing.
Test environments. stop() cancels and joins the server (and the HTTP drain controller), then cancels and joins the listeners, and reports failures after every join. Dropping stop() mid-way drops the join future, whose armed guard cancels the listeners (F3). The HTTP red/green test holds an announce whose header block is unterminated. lifecycle-signals is unchanged.
Tests and mutations. Test attributes base to head: manager 17 to 33, event flows 4 new, app 15 to 17, HTTP environment 7 to 11, UDP environment 8 to 12, one new persistence target. Without the unfinished_predecessors.insert(id) line, seven manager stop-order tests and the two app stop-order tests should fail; the before-shutdown, finished-before-cancel, busy-consumer and rejection tests stay green. The recorded mutations for edge recording and release-after-cancel name the tests that kill them.
Documentation and the ADR. The promoted ADR differs from the draft by the past tense, spawn_with, the three errors, the deadline and log clauses, section 8 and Affected Code; section 9 restates the superseded ADR's six points, policy, consequences and alternatives, and that ADR carries - Status: Superseded by. The five diagrams moved (four to application-jobs.md, one to events.md, which now has the swarm bus); no link pointed at the removed sections. The create-adr text fits the skill and what this PR did.
Records. ISSUE.md and EPIC.md pass the strict profiles; last-updated-utc is the newest commit's minute; every progress-log stamp precedes or matches its commit, and every record commit has its entry. The evidence counts match the bytes; a Python harness in an evidence folder has a precedent in the closed drain issue. Unticked acceptance criteria break no skill rule.
Links and lifecycle. 167 relative links and fragments in the 15 changed Markdown files resolve; the new public items are documented and their intra-doc links resolve.
Hygiene. Eight Conventional subjects tagged [#2416], author time equal to committer time, git diff --check clean per commit, bodies match their diffs; each carries an attribution footer naming the review bot's account, which no rule in the tree forbids. The PR-branch commit-id check prints nothing.
The review bot. Its three concerns are each pinned: ordering by the manager and app stop-order tests, deadline escalation by the never-asked and busy-consumer tests, abandoned-shutdown cleanup by the two abandoned-join tests.
Findings
- F1 Minor: the T10 status is stale in both records.
- F2 Minor: 'a UDP request cannot be held in flight' is contradicted by the crate's own hold sender.
- F3 Nit: an abandoned
stop()leaves cancelled, unjoined listener tasks. - F4 Nit: the UDP drop test asserts the post-drop snapshot.
- F5 Nit:
application-jobs.mdoverstates the rejection aftercancel(). - F6 Nit: the ADR still says the sub-EPIC holds the diagrams.
Checked, no finding: the independent tokens; the lock discipline; the double cancel(); the release after failure and panic; the deadline outcomes and logs; every bus declaration against the publish sites; the consumer-before-producer rule; the join-all failure reporting; the in-flight HTTP test; http_complete_download; the 10, 90 and 5 second figures; the superseded marker and index row; the glossary, inventory and feature documents; the strict frontmatter; the progress-log stamps; the commit-id check.
Checks
On the loop's compute hub at this head, merge base a843009af, the #2615 merge (receipt server-gates-sojka-394; git merge-tree against develop at 29e1f7ce3 is clean): pre-commit profile gate exit 0 (176 s); linter markdown, linter cspell, linter lychee exit 0; frontmatter-validator --all: 16 errors / 4 warnings at this head and 16 / 4 at the base re-measured, the same 20 diagnostics by path and category, none in the files this PR touches; cargo test -p torrust-tracker --lib exit 0 (146 passed, 0 failed, 0 ignored); cargo test -p torrust-tracker --test lifecycle-signals --test persistence-completed-downloads-on-shutdown exit 0 (14 passed across the two targets); cargo test over torrust-tracker-axum-http-server, torrust-tracker-udp-server and torrust-tracker-test-helpers exit 0 (361 passed, 0 failed, 1 ignored across nine suites); cargo clippy over those four packages with all targets and features and warnings denied exit 0; cargo doc --no-deps -p torrust-tracker with warnings denied exit 0; the test attributes number 33 in manager.rs, 4 in event_flows.rs, 17 in app.rs, 11 and 12 in the HTTP and UDP test environments and 1 in the new persistence test; a mutant that validates the stop-before edges in add_stop_before but never records them fails 7 of the 33 job-manager tests (the stop-order, release-on-failure and release-on-panic, deadline-abort and shutdown-plan tests) and passes the other 26. GitHub checks at this head at posting time: "Publish (Release): completed/skipped; Publish (Development): completed/skipped; Context: completed/success; Package Coverage Regression: completed/success; Package Coverage (torrust-tracker-http-core): completed/success; Package Coverage (torrust-tracker-test-helpers): completed/success; Package Coverage (torrust-tracker-axum-http-server): completed/success; Package Coverage (torrust-tracker-udp-server): completed/success; Package Coverage (torrust-tracker): completed/success; Docker E2E: completed/skipped; Build on windows-latest (nightly): completed/success; Workspace Packaging: completed/success; Unit (nightly): completed/success; Build on macos-latest (stable): completed/success; Build on ubuntu-latest (stable): completed/success; Build on ubuntu-latest (nightly): completed/success; Layer Boundary Bans: completed/success; Build on macos-latest (nightly): completed/success; Unit (stable): completed/success; Build on windows-latest (stable): completed/success; Documented Clippy Allows: completed/success; Discover Package Coverage: completed/success; Test (Docker) (release): completed/success; Generate Coverage Report: completed/success; Docs Lint: completed/success". At posting, develop is 29e1f7ce3.
|
ACK d42a357 — the stop-before edges, the bus declarations of every publishing component, the staged test-environment stops, the promoted ADR, the records and all 167 relative links were recomputed from the bytes at this head with no blocking finding |
… in the UDP drop test The precondition of the drop test measured the holders of the listeners' shared services after `drop(environment)` while its message printed the snapshot taken before it, so it held only because the current-thread runtime cannot run the listeners between the two lines. Assert the snapshot taken before the drop, as the HTTP twin does (review-finding:pr-2623-f4). Co-authored-by: Copilot <[email protected]>
… the late event when stopping The review of PR torrust#2623 found that "a UDP request cannot be held in flight" was wrong: the crate's own shutdown tests hold request processors at their `UdpRequestAccepted` publication. Wrap the UDP-server event sender in the test environment's tests the same way, so a connect request is still in flight while `stop()` drains the receive loop, and check that the accepted request is counted before `stop()` returns. It fails when the listeners are cancelled together with the receive loop (the environment's behavior with one token) and passes with the staged stop. The records that said the UDP environment had no deterministic red are corrected (review-finding:pr-2623-f2). Co-authored-by: Copilot <[email protected]>
…isteners without joining them Dropping the `stop()` future drops `join_owned_tasks` and its armed `DropGuard` cancels the listeners token, but the listener `JoinHandle`s are dropped with it, so the tasks finish their bounded drain unjoined. "Cannot leave a detached listener" overstated that. State what the code guarantees in the ADR, in sub-EPIC record entry 32, in the evidence, and in the two abandoned-join test comments. The body of the earlier commit that used the old words is history and is not rewritten (review-finding:pr-2623-f3). Co-authored-by: Copilot <[email protected]>
…dges are refused after cancel() `ShutdownRequested` refuses a registration that adds edges after `cancel()`; `spawn` without edges still succeeds and issues a cancelled token, and a component that names itself is refused as well. The jobs document read as if any registration after `cancel()` were rejected (review-finding:pr-2623-f5). Co-authored-by: Copilot <[email protected]>
…moved diagrams The five diagrams moved out of the sub-EPIC record into `events.md` and `application-jobs.md`, so the ADR's reference to the sub-EPIC no longer promises them there (review-finding:pr-2623-f6). Co-authored-by: Copilot <[email protected]>
…PIC plan The T10 row of the issue still listed the independent review, the retrospective, and the script decision as pending, and the sub-EPIC plan row still read `TODO` while its Subissues row said `IN_PROGRESS`. Only the maintainer's acceptance review is left (review-finding:pr-2623-f1). Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
… 2623 Six findings of the requested reviewer (two minor, four nits): all fixed in their own commits, replied to, and resolved; the Copilot review had no inline finding. The validation script reports zero failures. Co-authored-by: Copilot <[email protected]>
…623 in the audit Add the F18 row and detail entry and a Processing Log entry, and append the round to the spec progress log. The validator reports 18 rows and 0 failures. Co-authored-by: Copilot <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 734cebb64f270ed6e72b827aec65256c0625e155. Recomputed from the bytes at this head, against the merge base 67e37efd3 (the #2626 merge); git merge-tree against develop 5e9e575d8 is clean (exit 0, no conflict). The 34 earlier commits keep their ids. The two new ones change PR-REVIEW.md and ISSUE.md only: no code, no other file.
The repairs. F18: c1ac427 sets the F17 entry to N/A. A census of every detail entry finds all eighteen Reviewer finding ID fields at N/A, each under its own Finding ID, none reassigned, so the reply's sweep holds. The reply came at 08:12:59, after the push and dismissal at 08:12:54, and cites c1ac427's subject. Its count of 0 is true at that pushed head. F18 is repaired.
The audit record. The F18 row matches the posted finding (title, Nit, ORIGINAL, FIXED), and all eighteen threads are resolved. The new log entry and the spec's progress-log line are stamped 08:13 and committed at 08:13:35. They match the timeline in both directions: review at 19:06 on 2026-10-23, fix pushed at 08:12:54, reply at 08:12:59, audit pushed at 08:16:12. Run offline with the captured comments, the audit validator reports 18 rows, 11 log entries and 0 failures. The retrospective is unchanged and states its scope as the reviews up to round 6, so its counts still agree with the record. One verification line does not hold at this head (F19).
Links and hygiene. 171 relative links and fragments resolve, and the strict profiles pass. git diff --check is clean, and no earlier log line changed. Both subjects are Conventional and tagged [#2416]; each carries an attribution footer naming the review bot's account, which no rule in the tree forbids. The PR-branch commit-id check prints nothing.
The review bot. No review at this head.
Findings
- F19 Minor: the F18 verification says its pipeline prints 0, but at this head it prints 1. The F18 heading that the same commit added quotes the old field and matches.
Checked, no finding: the census of every field; reply order and its claim at the pushed head; the audit row, threads, log and validator; the stamps; the retrospective's scope; links; the commit-id check; no code changed.
Checks
On the loop's compute hub at this head, merge base 67e37efd3, the #2626 merge (receipt server-gates-sojka-435; git merge-tree against develop at 5e9e575d8, the #2627 merge, is clean): pre-commit profile gate exit 0 (153 s); linter markdown, linter cspell, linter lychee exit 0; frontmatter-validator --all: 16 errors / 4 warnings at this head and 16 / 4 at the base re-measured, the same 20 diagnostics by path and category, none in the files this PR touches; the audit validator over docs/pr-reviews/pr-2623-review/PR-REVIEW.md with the captured review comments: ok, 18 rows, 11 log entries, 0 failures. No code changed in this round, so no Rust tests ran. GitHub checks at this head at posting time: "Package Coverage (torrust-tracker-udp-server): completed/success; Package Coverage (torrust-tracker): in_progress/pending; Package Coverage (torrust-tracker-test-helpers): completed/success; Package Coverage (torrust-tracker-axum-http-server): completed/success; Docker E2E: completed/skipped; Workspace Packaging: completed/success; Layer Boundary Bans: completed/success; Unit (nightly): in_progress/pending; Documented Clippy Allows: completed/success; Unit (stable): in_progress/pending; Test (Docker) (release): in_progress/pending; Discover Package Coverage: completed/success; Docs Lint: completed/success; Generate Coverage Report: completed/success; Build on macos-latest (stable): completed/success; Build on windows-latest (nightly): completed/success; Build on windows-latest (stable): completed/success; Build on ubuntu-latest (stable): completed/success; Build on macos-latest (nightly): completed/success; Build on ubuntu-latest (nightly): completed/success". At posting, develop is 5e9e575d8.
|
ACK 734cebb — every reviewer finding ID field, the reply's order and its count at the pushed head, the audit record (validator 0 failures over 18 rows) and all 171 relative links were recomputed from the bytes at this head with no blocking finding |
…es not match its own entry The F18 verification counted every line that names the reviewer finding ID field, including the F18 heading that quotes it. Anchor the pattern to the start of a field line, which prints 0 at this commit. Co-authored-by: Copilot <[email protected]>
…623 in the audit Add the F19 row and detail entry and a Processing Log entry, and append the round to the spec progress log. The validator reports 19 rows and 0 failures. Co-authored-by: Copilot <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 4d0d764bb32063b73e5dccf8a45f654aafcc98f5. Recomputed from the bytes at this head, against the merge base 67e37efd3 (the #2626 merge); git merge-tree against develop 5e9e575d8 is clean (exit 0, no conflict). The 36 earlier commits keep their ids. The two new ones change PR-REVIEW.md and ISSUE.md only: no code, no other file.
The repairs. F19: cb6b908 anchors the F18 pattern to ^- Reviewer finding ID:. Run verbatim at this head, it prints 0. The unanchored form still matches the F18 heading, so the anchor is what makes the line true. The F19 entry quotes the same command, which also prints 0 with that entry written. Every other locally runnable verification in the audit (F1 to F17) was re-run as written and prints what it says. The reply came at 08:33:42, after the push and dismissal at 08:33:36, and cites cb6b908's subject. F19 is repaired.
The audit record. The F19 row matches the posted finding (title, Minor, ORIGINAL, FIXED). The intro names round 8 and its review. All nineteen Reviewer finding ID fields are N/A, and all nineteen threads are resolved. The new log entry and the spec's progress-log line are stamped 08:34 and were committed at 08:34:46, after the reply's last edit (08:34:06), and the audit was pushed at 08:37. Run offline with the captured comments, the audit validator reports 19 rows, 12 log entries and 0 failures. The retrospective is unchanged and states its scope as the reviews up to round 6, which is still true. Two details of the new log entry do not match the thread (F20, F21).
Links and hygiene. 171 relative links and fragments resolve, and the strict profiles pass. git diff --check is clean. The round-8 head is an ancestor, so there was no rebase, and only Markdown changed. Both subjects are Conventional and tagged [#2416]; each carries an attribution footer naming the review bot's account. The PR-branch commit-id check prints nothing.
The review bot. No review at this head; its last review was in round 4, and it has not been re-requested since.
Findings
- F20 Nit: the round-8 log entry says review 5637524522 was submitted at 08:30 UTC. GitHub's
submitted_atis 08:29:05. - F21 Nit: the same entry says the reply was edited twice and that the edit is stated in the reply, but the reply's own note reads "Edited once". One of the two is wrong about the reply.
Checked, no finding: the anchored pipeline and the unanchored control; every quoted verification re-run. The reply's sweep: F6, F12 and F14 search outside the audit; F2 and F9 list their matches; the bracketed F15/F17 search, which the sweep does not name, prints nothing. Also: reply order; the row, intro, field census, threads and validator; the stamps; the retrospective's scope; links; the commit-id check; no code changed.
Checks
On the loop's compute hub at this head, merge base 67e37efd3, the #2626 merge (receipt server-gates-sojka-438; git merge-tree against develop at 5e9e575d8, the #2627 merge, is clean): pre-commit profile gate exit 0 (88 s); linter markdown, linter cspell, linter lychee exit 0; frontmatter-validator --all: 16 errors / 4 warnings at this head and 16 / 4 at the base re-measured, the same 20 diagnostics by path and category, none in the files this PR touches; the audit validator over docs/pr-reviews/pr-2623-review/PR-REVIEW.md with the captured review comments: ok, 19 rows, 12 log entries, 0 failures. No code changed in this round, so no Rust tests ran. GitHub checks at this head at posting time: "Package Coverage Regression: completed/success; Package Coverage (torrust-tracker-udp-server): completed/success; Package Coverage (torrust-tracker): completed/success; Package Coverage (torrust-tracker-axum-http-server): completed/success; Package Coverage (torrust-tracker-test-helpers): completed/success; Docker E2E: completed/skipped; Workspace Packaging: completed/success; Unit (nightly): in_progress/pending; Unit (stable): completed/success; Documented Clippy Allows: completed/success; Layer Boundary Bans: completed/success; Test (Docker) (release): in_progress/pending; Discover Package Coverage: completed/success; Build on macos-latest (stable): completed/success; Generate Coverage Report: completed/success; Build on ubuntu-latest (nightly): completed/success; Build on windows-latest (nightly): completed/success; Build on windows-latest (stable): completed/success; Build on macos-latest (nightly): completed/success; Docs Lint: completed/success; Build on ubuntu-latest (stable): completed/success". At posting, develop is 5e9e575d8.
|
ACK 4d0d764 — the anchored F18 pipeline and every quoted verification, the reply's order at the pushed head, the audit record (validator 0 failures over 19 rows) and all 171 relative links were recomputed from the bytes at this head with no blocking finding |
…ew time and edit count Append a correction naming the entry: the review was submitted at 08:29, and the reply on the F19 thread was edited three times. The reply now points to the log instead of counting its own edits. Co-authored-by: Copilot <[email protected]>
…623 in the audit Add the F20 and F21 rows and detail entries and a Processing Log entry, and append the round to the spec progress log. The validator reports 21 rows and 0 failures. Co-authored-by: Copilot <[email protected]>
|
ACK 01a65ac |
…sues/closed Issue #2416 is closed on GitHub and PR #2623 is merged. Move the spec folder, set status done, tick the acceptance criteria at the maintainer's instruction (his review and merge count as the acceptance review), repoint the live references (the sub-EPIC Subissues row, the ADR link, the review audit's related artifacts, the moved files' relative links and frontmatter) and add the progress-log entries. The sub-EPIC is not closed here. Co-authored-by: Copilot <[email protected]>
…ssues/closed f4ee048 chore(issues): [#2416] archive the closed issue #2416 spec to docs/issues/closed (Jose Celano) Pull request description: Archives the spec for issue #2416 (closed on GitHub; PR #2623 merged on 2026-10-24) from `docs/issues/open/` to `docs/issues/closed/`. - Verified issue #2416 is `CLOSED` on GitHub (`gh issue view 2416`). - Moved the spec folder with `git mv`; set `status: done`, the new `spec-path` and `last-updated-utc`. - Ticked AC1 to AC6, the `linter all` criterion and the last workflow checkpoint, and set the evidence rows to `ACCEPTED`, at the maintainer's instruction: his review and merge of PR #2623 count as the acceptance review, as for #2414 and #2415. - Repointed the live references: the sub-EPIC Subissues row (now `DONE`) and progress log, the ADR link, the review audit's related artifacts, and the relative links and frontmatter inside the moved files. A script over the changed Markdown files checks that every relative link resolves (0 broken). Historical verification commands in the review audits keep the path they ran at. - Sub-EPIC #2410 is not closed or archived here and the #1488 roadmap is not edited. - `linter all` and the pre-commit and pre-push hooks passed. ACKs for top commit: josecelano: ACK f4ee048 Tree-SHA512: f105087fcb74c96aaaeb859917a980fd32de51162b6803cf7b691a5eadea56b2379e282f57049a6348ace1dd176114f1abbef023581f5dbd5aab67e74fc447e3
da2ce7
left a comment
There was a problem hiding this comment.
Label: POST_MERGE_FINDINGS — this pull request merged at 12:19:07Z as a743450b0, at exactly the head reviewed here, before this review was posted; this round records no new finding and blocks nothing.
Reviewed at 01a65acee5ad708444a29e58700bcf98f41a06ff. Recomputed from the bytes at this head, against the merge base 67e37efd3 (the #2626 merge); git merge-tree against develop 5e9e575d8 is clean (exit 0, no conflict). The 38 earlier commits keep their ids. The two new ones are single-parent commits that change PR-REVIEW.md and ISSUE.md only: no code, no other file.
The repairs. F20: 3ab819e appends one log line (361) that names the round-8 entry and removes no line, so the entry stands and the log stays append-only. Its 08:29 matches submitted_at 08:29:05. A scripted comparison of every review time in the log with its review's submitted_at agrees to the minute, except the original 08:30, which the correction now covers. F21: the F19 reply no longer counts its own edits and points to the log, and its updated_at is 08:52:36, as the correction says. The comment data shows at least two edits: at round 9, updated_at was 08:34:06 against created_at 08:33:42, with the "(Edited once: …)" note, and the body changed again by 08:52:36. It cannot show whether one or two edits came before 08:34:06, so the count of three is the author's own account. The F21 entry and its reply say so ("my own calls"); the log line gives the count without that source. Both replies came at 08:56:07 and 08:56:08, after the push and dismissal at 08:55:59, and cite 3ab819e's subject. Every other quoted verification (F1 to F19) was re-run as written and prints what it says. F20 and F21 are repaired.
The audit record. The F20 and F21 rows and headings match the posted findings (titles, Nit, ORIGINAL, FIXED). The intro names round 9. All twenty-one Reviewer finding ID fields are N/A, and all twenty-one threads are resolved. The correction is stamped 08:52, after the reply edit it describes and before its commit at 08:53:07. The round-9 entry and the spec's progress-log line are stamped 08:56 and 08:57, and were committed at 08:57:32. They match the timeline in both directions: review at 08:50:21, ACK at 08:50:25, reply edit at 08:52:36, push at 08:55:59, replies at 08:56, audit pushed at 09:00:40. Run offline, the audit validator reports 21 rows, 14 log entries and 0 failures. The retrospective is unchanged, and its scope (up to round 6) still holds.
Links and hygiene. 171 relative links and fragments resolve, and the strict profiles pass. git diff --check is clean. The round-9 head is an ancestor, and only Markdown changed. Both subjects are Conventional and tagged [#2416]; each carries an attribution footer naming the review bot's account, and neither message holds a closing keyword. The PR-branch commit-id check prints nothing.
The review bot. No review at this head. Its last review was in round 4, and the capture holds no re-request since 2026-10-23.
Findings: none.
Checked, no finding: the appended correction and the unchanged entry; review times against submitted_at; what the comment data shows of the edit count; reply order; the rows, intro, field census, threads and validator; the stamps; the retrospective; links; the commit messages; the commit-id check; no code changed.
Checks
On the loop's compute hub at this head, merge base 67e37efd3, the #2626 merge (receipt server-gates-sojka-439; git merge-tree against develop at 5e9e575d8, the #2627 merge, is clean): pre-commit profile gate exit 0 (85 s); linter markdown, linter cspell, linter lychee exit 0; frontmatter-validator --all: 16 errors / 4 warnings at this head and 16 / 4 at the base re-measured, the same 20 diagnostics by path and category, none in the files this PR touches; the audit validator over docs/pr-reviews/pr-2623-review/PR-REVIEW.md with the captured review comments: ok, 21 rows, 14 log entries, 0 failures. No code changed in this round, so no Rust tests ran. GitHub checks at this head at posting time: "Publish (Development): completed/skipped; Publish (Release): completed/skipped; Context: completed/success; Package Coverage Regression: completed/success; Package Coverage (torrust-tracker-axum-http-server): completed/success; Package Coverage (torrust-tracker-test-helpers): completed/success; Package Coverage (torrust-tracker-udp-server): completed/success; Package Coverage (torrust-tracker): completed/success; Docker E2E: completed/skipped; Unit (stable): completed/success; Unit (nightly): completed/success; Layer Boundary Bans: completed/success; Workspace Packaging: completed/success; Documented Clippy Allows: completed/success; Test (Docker) (release): completed/success; Discover Package Coverage: completed/success; Build on macos-latest (nightly): completed/success; Generate Coverage Report: completed/success; Build on windows-latest (nightly): completed/success; Build on macos-latest (stable): completed/success; Build on ubuntu-latest (stable): completed/success; Docs Lint: completed/success; Build on ubuntu-latest (nightly): completed/success; Build on windows-latest (stable): completed/success". At posting, develop is 8f8b4d714.
…ust#2623 added a helper Co-authored-by: Copilot <[email protected]>
…otocol helpers 3a62c7e docs(pr-reviews): [#2628] audit review round 6 of the spec PR (Jose Celano) 8c5add9 docs(issues): [#2628] refresh the http module facts after #2623 added a helper (Jose Celano) ae08130 docs(pr-reviews): [#2628] cite the round 3 head by subject in the F12 correction (Jose Celano) 2b04ce1 docs(pr-reviews): [#2628] audit review round 5 of the spec PR (Jose Celano) 92d01ef docs(pr-reviews): [#2628] correct the F11 reply and push order in the audit log (Jose Celano) a4a6604 docs(pr-reviews): [#2628] audit review round 4 of the spec PR (Jose Celano) 1f73f16 docs(pr-reviews): [#2628] record the round 3 review state and tighten the log (Jose Celano) f7610cb docs(pr-reviews): [#2628] audit review round 3 of the spec PR (Jose Celano) 77fa4db docs(pr-reviews): [#2628] correct the round 2 order in the audit processing log (Jose Celano) 03203ff docs(pr-reviews): [#2628] cite the commit subject for the F7 fix (Jose Celano) 40475f3 docs(pr-reviews): [#2628] record the round 2 review as approved (Jose Celano) a6d3e66 docs(pr-reviews): [#2628] audit review round 2 of the spec PR (Jose Celano) 6eeef9a docs(issues): [#2628] restamp the EPIC and inventory edited by the spec PR (Jose Celano) d426623 docs(issues): [#2628] say that rule B.3 already keeps B.1 a convention (Jose Celano) ce77052 docs(pr-reviews): [#2628] audit review round 1 of the spec PR (Jose Celano) 7f5c8a9 docs(issues): [#2628] restore the draft path in the drafted checkpoint (Jose Celano) 98f216b docs(issues): [#2628] name the spec branch and keep status planned until the spec PR merges (Jose Celano) 99954e3 docs(issues): [#2628] state which crates the deny.toml check covers (Jose Celano) d0c13f2 docs(issues): [#2628] file the EPIC row 2 progress-log line under Progress Log (Jose Celano) 6b5854c docs(issues): [#2628] specify moving the test-helpers protocol helpers (Jose Celano) Pull request description: Related to #2628 Spec-only PR for row 2 of #2482: moves the `test-helpers` `http` and `udp` modules to the root `tests/common/` (ADR rule B) and adds the `deny.toml` bans. The maintainer approved the spec before this PR. ACKs for top commit: da2ce7: ACK 3a62c7e — recomputed at this head the F13 and F14 repairs against the commit-id check, the template's rewrite rule and a scripted count of http.rs on develop 8f8b4d7, the audit rows, dismissals, log stamps and validator, and all 58 links, with two non-blocking Nits josecelano: ACK 3a62c7e Tree-SHA512: eb8a5f858915b7658e3ea6c745e6ace5d3e922dd2fb85d12b24cc60679d306538843cc0ad75a7c34ade9546aad4d478a129d5f919ad32be419f7af917f24f64b
…its spec to docs/issues/closed c19fca7 chore(issues): [#2410] close sub-EPIC SI-22 and archive its spec to docs/issues/closed (Jose Celano) Pull request description: ## Summary Closes #2410 All four sub-issues of sub-EPIC #2410 (SI-22, process queued events before listeners stop) are merged and archived: #2413 in PR #2553, #2414 in PR #2578, #2415 in PR #2591, and #2416 in PR #2623. This PR closes the sub-EPIC itself, which was still open on GitHub with its acceptance criteria and workflow checkpoints unticked and its completion review unassessed. It follows the precedent of PR #2557 (EPIC #2243): the archive and the closing keyword travel together. ## What changed - Moved `docs/issues/open/2410-1488-si-22-process-queued-events-before-listeners-stop/` to `docs/issues/closed/` with `git mv`, set the EPIC to `status: done` with the new `spec-path`, and kept `reproduce-lost-completions.sh` in the folder (the maintainer decided to keep it at the #2416 checkpoint). - Filled the Acceptance Verification table (AC1 to AC13) with the artifact behind each criterion, ticked the criteria and workflow checkpoints, marked M2 and M3 done with their evidence, and filled the Implementation Completion Review. Qualifications are kept, not dropped: the 5 s drain default is a policy choice and not derived from the measurement, the race runs do not prove loss window (b), a shared-deadline abort leaves an in-progress outcome unknown, the UDP environment's red is by mutation, and bus retention through listener join is read from source and not run. - Added `agent-review-reports.md` with the independent Task Reviewer review of this close-out (verdict `REVIEW PASSED WITH FINDINGS`, 3 should-fix and 4 nits, all fixed in this commit). - Repaired every live link to the old folder (the four archived sub-issue specs and their retrospectives and evidence files, the #2412 and #2448 specs, the glossary, and the promoted ADR) and bumped `last-updated-utc` on each touched document that carries it. - Set row 15 of the EPIC #1488 roadmap to `Done` and updated the three SI-22 statements in that spec that still described it as pending. - Repointed the draft-ADR reference in the #2418 spec to the promoted ADR. ## Acceptance The criteria and checkpoints are ticked in advance of the merge, as in #2557, and the progress-log entry says so: the maintainer's review and merge of this PR are the acceptance review, as for #2414 to #2416. If the review changes any criterion, it should be unticked before the merge. ## Deliberately retained references The old folder path remains only in historical records: two recorded commands in the sub-EPIC and #2414 evidence files, the "moved to" checkpoint text in the EPIC, and the review audits under `docs/pr-reviews/` (`pr-2421-review`, `pr-2553-review`). ## Not part of this PR Follow-ups #2418 (batch persisted download writes) and #2411 (spam and abuse EPIC) stay open and do not block this close-out. #2406 and #2417 are already closed. No sub-EPIC-level implementation retrospective was written, and the completion review gives the reason. ## Validation - `linter all` exits 0, including the local link and fragment check, which skips `docs/issues/closed/`, so the archived files were also checked with lychee and an empty config: 100 links OK, 0 errors. - The signed commit passed the pre-commit hook, including the frontmatter validator and `cargo test --doc --workspace`. - `git merge-tree` against `torrust/develop` shows a clean merge. - Documentation only: no code changed. No tests were re-run beyond the hook's doc tests; the acceptance claims about tests cite the sub-issues' recorded runs and the test names found on the tree (read from source, not run). ACKs for top commit: josecelano: ACK c19fca7 Tree-SHA512: de784fead66e0eb1b6b9b7bf7e7aea9d29a2a3dbd297740752d23eca6fbaa700f20926e81033fdc06d31b72ff0f00302f522df7bce8354de87a3c9d48a0c7121
Summary
This is sub-issue 4 of 4 of sub-EPIC #2410 (SI-22, under EPIC #1488). It closes loss window (b): events published after every listener of their bus had stopped were lost, because
JobManager::cancel()cancelled every component at the same moment. Listeners are now cancelled only after every component that publishes on their buses has completed, or the shared deadline has aborted it.JobManager::spawn_withtakesStopBeforeedges (spawnstays and means "no edges").cancel()cancels the components that wait for nobody;wait_for_allcancels each of the others when the last component it waits for has completed in any state, and never beforecancel(). Registration rejects unknown, released, foreign, not-earlier ids and edges aftercancel()without leaving state behind. Logs name what each component waits for and what released it.EventFlowsandBus(src/bootstrap/event_flows.rs) turn per-bus declarations into edges and reject a consumer registered after a producer of its bus;src/app.rsdeclares the buses of the HTTP and UDP instances and of torrent cleanup.DropGuardeach (D20), join-all failure reporting kept, and an abandonedstop()cancels the listeners without joining them, so none is left that was never asked to stop.docs/adrs/and the cancellation-tree ADR is marked superseded; the five diagrams moved todocs/architecture/events.mdandapplication-jobs.md, which also documents the swarm bus thatevents.mdomitted; the glossary, task inventory, and shutdown feature documents describe the final implementation; thecreate-adrskill documents the draft-ADR process (D15).Closes #2416
Validation
JobManagerstop-order test and a test on the real swarm event bus with controlled late producers were red against edges that were stored but not enforced, and are green now. Each test environment has a deterministic red and green late-event test (a request held in flight whilestop()drains; the UDP one was added in review round 1), the UDP answered-request test is regression coverage, and the order is also guarded by staged-join unit tests. One mutation per lifecycle clause is recorded.reproduce-lost-completions.shwith the T0 parameters): control 500 of 500 persisted twice; race, two runs, answered minus persisted 0, no lag, abort or failure. After Drain listener queues on shutdown #2414 the real binary no longer loses events in this scenario, so the race runs are a recheck and not the proof of window (b); the stop-order logs under a mixed HTTP and UDP burst are in the evidence.linter all, the pre-push checks (exit 0) andcargo test --test lifecycle-signalspass. An independent Task Reviewer report (no blocking finding) and the retrospective are in the issue folder.docs/issues/open/2416-2410-si-22-4-stop-producers-before-listeners/manual-verification-evidence.md(V1 to V8; V8 retains the recheck logs in theevidence/folder) and sub-EPIC record entries 31 and 32.Notes
The branch was cut from
developat the merge of #2615 and updated twice withdevelopby signed merge commits, not rebased, so the ids the review records cite stay valid: first for a conflict indocs/adrs/index.md(review round 3: the 20261021190318 row thatdevelopappended; both rows are kept), then, clean, when GitHub reported the branch out of date. No temporary local patches are part of the branch. Sub-EPIC #2410 is not closed by this PR. The review audit isdocs/pr-reviews/pr-2623-review/PR-REVIEW.md, and the review retrospective written at the maintainer's request isdocs/pr-reviews/pr-2623-review/review-retrospective.md.