Skip to content

feat: live diagnostic sink, per-file peer lines in production order - #8363

Merged
oferchen merged 2 commits into
masterfrom
feat/live-diag-sink
Nov 13, 2026
Merged

oferchen merged 2 commits into
masterfrom
feat/live-diag-sink

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Diagnostics now go out as they are produced instead of being collected and printed at the end, as rsync 3.5.1 does through rwrite (log.c).

  • A session-scoped LogContext carries a live sink. Rayon workers and the disk-commit thread inherit it, so their lines join the session that queued them.
  • Server side: PeerSink queues each line in a PeerOutbox. MultiplexWriter sends queued lines before its next write, in production order. The writer alone routes each line by msgs2stderr (MessageRoute::writes_locally, log.c:357-366) and remaps codes for protocols below 30 (frame_code, compat.c:653-654). The sink keeps upstream's codes.
  • Client side: remote transfers print receiver lines through a live stdio sink. A pulled or pushed file is named only after its output opens and before its data, as in 3.5.1.
  • Per-file peer outcomes, backup notices included, arrive in file order.
  • Perf: the verbosity check and the outbox has_pending test are inline; the refresh path is #[cold].

Tests

  • queued_lines_follow_the_errors_to_stderr_route, queued_lines_follow_the_all_to_stderr_route, queued_lines_are_framed_and_remapped_by_the_writer (V31 1,3,4,2; V29 1,1,2,2).
  • the_queue_keeps_upstreams_codes.
  • Daemon-log ordering tests; pull and push "names each file before its data" cells.

Mutations (all killed)

  • outbox has_pending = false: 2 daemon_log tests.
  • bypass send_routed: all 3 queued_lines tests.

@oferchen
oferchen force-pushed the feat/live-diag-sink branch from e69422c to b9d7234 Compare November 13, 2026 10:15
@oferchen
oferchen merged commit 00c5900 into master Nov 13, 2026
87 checks passed
@oferchen
oferchen deleted the feat/live-diag-sink branch November 13, 2026 11:58
oferchen added a commit that referenced this pull request Nov 14, 2026
Stacked on #8363 (live diagnostic sink); review that first.

With a role trace requested, a local copy prints rsync 3.5.1's per-role
trace lines, and oc's pipeline internals no longer appear in any `-v`
row.

- A local copy runs over a server child when a role trace is requested
(GENR/RECV/SEND/EXIT >= 1, FLIST >= 2, or PIPELINE >= 1), as upstream's
`local_child` (pipe.c) forks one. Otherwise the copy stays in process.
- Sender DELTASUM2/SEND1 traces on the whole-file path, with F_PATHNAME
names. Receiver `get_local_name` trace. The client logs a transferred
name before its data. The summary leaves the banner and `-vv` notices to
the server child. The oc-only "created destination root" line is
dropped.
- New oc-only debug word `PIPELINE`, in no `-v` row and not forwarded.
Level 1 prints phase timings, call totals, the partitioned file list,
the seeded lazy producer and receiver config. Level 2 prints segment
reclaim, inc_recurse producer and remote-shell wire detail. It is listed
under "oc-rsync extensions" in `--debug=help` (hand-added until task 446
generates that text).
- seccomp/landlock lines stay in the `-vvv`/`-vvvv` rows.

## Tests

- `pipeline_debug_word`: `no_verbosity_prints_a_pipeline_line` (-vvvvv),
`the_pipeline_word_prints_its_lines_by_level`.
- Oracle `local_vvv_prints_no_oc_only_line_but_the_sandbox_ones`: `-vvv`
and `-vvvv` against 3.5.1, line shapes compared with the root and
numbers masked. The only allowed oc-only lines start with `landlock: `
or `seccomp: `.
- `a_role_trace_selects_the_server_child`.
- output_parity role-trace cells now run the real binary.
- Full targeted set: 417/417 with `OC_RSYNC_UPSTREAM_COMPAT=1` and the
3.5.1 oracle, in a clean target.

## Mutations (all killed)

- PIPELINE removed from the role-trace predicate: 2 tests.
- PhaseTimer back on TIME: all 3 `pipeline_debug_word` tests, including
the oracle.

## Known open item

In an earlier gate run that shared one target directory between two
worktrees, `local_vvv_prints_no_oc_only_line_but_the_sandbox_ones`
failed once (416/417, 7.08 s). The same run also produced a
stale-artifact clippy error, so a stale build is the likely cause, but
that run's output was not captured and the failure is not root-caused.
It passed 3/3 alone and in the full 417 in a clean target. If it fails
in CI, it gets investigated from the full output, not retried.

## Follow-ups

Tasks 587 (rate grouping), 579, 580. Next: the remaining upstream `-vvv`
lines, one role at a time, each with a 3.5.1 cell.
oferchen added a commit that referenced this pull request Nov 18, 2026
#8434)

Two documentation changes for the 0.6.5 release.

**Changelog.** Every PR merged since v0.6.4 was checked against
`[Unreleased]`.
- Seven lines cited five PRs that were closed without merging; they now
cite the PRs that carried the work (#8295, #8304, #8314, #8353, #8383).
- Three lines added by #8363 were no longer in the file and are
restored.
- Eighteen merged PRs with user-visible changes had no entry and now
have one.
- One entry moved from Added to Fixed.

**Differences from rsync 3.5.2.** New
`docs/differences-from-rsync-3.5.2.md`, linked from the README and the
environment reference. It lists behaviour kept on purpose, upstream
fixes adopted early (none yet, three pending), oc-rsync extensions
(options, transports, daemon parameters, debug words, sandboxing,
environment variables, the opt-in consecutive-match extension) and links
to the platform documents. Every row is backed by code or a test.

No code changes.

Closes #8564
Closes #8565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant