Repository navigation
fix(daemon): clear the master red - rustdoc link, racing converter cause, and a pre-mangled log operand - #7639
Merged
Merged
Conversation
…le doc `rustdoc links (informational)` has been red on master, reporting exactly two errors, both at crates/fast_io/src/io_uring/mod.rs:117 - the `///` comment on `pub mod send_zc;`: error: unresolved link to `ZeroCopySender` error: unresolved link to `ZeroCopySender::send_zc` Two things combine to produce them, and neither is visible on its own. `ZeroCopySender` is `#[cfg(feature = "iouring-send-zc")]` at BOTH the struct (send_zc.rs:320) and the re-export (mod.rs:166), so in a DEFAULT build the type does not exist and no path can resolve to it. Separately, `pub mod send_zc;` carries a `///` comment, and rustdoc concatenates that with the module's own `//!` block and resolves the result in the OUTER module's scope - which is why the errors are reported against mod.rs:117 rather than against the `//!` lines in send_zc.rs that actually contain them. crates/logging-sink/src/escape.rs documents this same concatenation trap in its own header. Both links become plain code spans. The prose already said the type is exposed "when the `iouring-send-zc` cargo feature is enabled", so nothing is lost: a link that cannot resolve in the configuration the doc gate actually builds is not carrying the reader anywhere. An `--all-features` doc build cannot see either half of this, which is how the broken link reached master in the first place - the note now says so at the site, so the next reader does not "fix" it back into a link. Verified: `RUSTDOCFLAGS="-D warnings" cargo doc -p fast_io --no-deps` on a default build is clean. The red baseline is CI's own two errors at this exact file and line.
`a_dead_converter_fails_instead_of_answering_unknown` is the first of the two tests that turned master red: it appeared at ed5a38b (#7627, an unrelated sender diff), one commit after the run at 7a82dea that was green, and it failed on all three nextest retries with assertion `left == right` failed: the recorded cause must be reported, not a fresh one: name converter: writing the request: Broken pipe (os error 32) left: BrokenPipe right: UnexpectedEof The assertion pinned `UnexpectedEof` as the recorded cause. Which cause gets recorded is a RACE, and both arms are legitimate: the child is `exit 0`, so if it has already exited and closed the pipe when the first lookup runs, the request WRITE fails with EPIPE and BrokenPipe becomes the sticky cause; if it has not yet exited, the write lands and the answer READ hits EOF, recording UnexpectedEof. Neither outcome is a defect - the host just decides which one wins. What the test exists for is the property one line below it in its own comment: that the death is RECORDED and REPLAYED rather than the stream being spoken to again. That property is orthogonal to which errno won the race, so the test now captures whichever cause the first failure recorded and asserts the later lookup reports THAT, plus a bound that the cause came from the pipe at all (`UnexpectedEof | BrokenPipe`) rather than some unrelated error. This deliberately keeps two assertions rather than deleting the errno check: without the pipe-cause bound, a converter that failed for a completely different reason would satisfy "sticky" trivially. daemon --lib name_converter_tests: 16/16.
`daemon_log_file_escaping` is the second of the two tests that turned master red. It failed at its own non-vacuity guard, not at an assertion: PR #7633 stopped writing the client's argument vector to the daemon log - correctly, since upstream never writes it at all - and that vector was the test's only subject. With nothing peer-supplied left in the log, every later assertion would have passed vacuously, and the guard said so. Re-pointing the test at a vector oc does log measured a real divergence. Upstream escapes in the SINK. `logit()` is the only writer of `logfile_fp` and hands every line to `filtered_fwrite(logfile_fp, buf, len, 0, 1, trailing)` (log.c:126-132), so no call site needs to pre-clean its operands and none of upstream's do: `clientserver.c:787` passes the module name straight into `rprintf(FLOG, "rsync %s %s from %s@%s (%s)\n", ...)`. oc ports that `filtered_fwrite` faithfully in `crates/logging-sink/src/escape.rs`. But seven of oc's daemon log builders wrapped the module name in `sanitize_module_identifier` first, which replaces every control character with `?`. Measured on a module named `A<ESC>B`, requested over a raw @rsyncd handshake, master writes BOTH renderings into the SAME log file: rsync allowed access on module A?B from localhost (127.0.0.1) module 'A\#033B' from localhost (127.0.0.1): 0 client args The second line is already correct - `client_args_log_line` does not sanitise, so the sink escapes reversibly. The first is lossy: `?` cannot be undone, and a reader cannot tell an escaped byte from a literal question mark. Two builders naming the same peer string in the same file disagreed about what it says. The sanitiser call is removed from all seven builders. It is deliberately KEPT on the wire `@ERROR` reply path, which is a different sink with no escaping layer of its own; that is a separate decision and is not touched here. The doc on `log_module_refused_option` claimed the name was "sanitised to strip control chars" - true when written, false after this change - so it now says the sink escapes it. Leaving it would have been exactly the drift this repo keeps getting bitten by. The test moves onto the module name as its vector and asserts three things: the escaped form is present, the mangled form is absent, and no raw ESC byte reached the file. The already-correct client-args line is the in-run control that proves the sink works and the fixture is live, alongside a plain-named control module. Its header records what is NOT covered: an unresolvable module name, which upstream also logs (clientserver.c:1568) but oc cannot, because it opens a log sink only per resolved module. That is a real separate gap, filed rather than faked. RED/GREEN proven by restoring the sanitiser calls: the test fails on the mangled-form assertion, printing both disagreeing lines. daemon 1800/1800; daemon + log-file sweep 82/82; fmt clean.
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.
Clears the three failures that have been red on master since #7627, and that
every open PR inherits. Three independent commits; each is separately
mutation-proven and none depends on the others.
1.
rustdoc links (informational)— two unresolved linksBoth errors were reported at
crates/fast_io/src/io_uring/mod.rs:117, the///comment on
pub mod send_zc;. Two things combine, and neither is visible alone:ZeroCopySenderis#[cfg(feature = "iouring-send-zc")]at both the structand the re-export, so in a default build no path can resolve to it.
pub mod///comment with that module's own//!block and resolves the result in the outer module's scope — which is why
the errors point at
mod.rs, not at the//!lines insend_zc.rsthatactually contain them.
An
--all-featuresdoc build cannot see either half, which is how this reachedmaster. Both links become plain code spans, and the note at the site says why,
so the next reader does not "fix" them back into links.
2.
name_converter— a first-cause assertion that racesa_dead_converter_fails_instead_of_answering_unknownpinnedUnexpectedEofasthe recorded cause; CI measured
BrokenPipeon all three nextest retries. Botharms are legitimate: the child is
exit 0, so if it has already exited when thefirst lookup runs, the request write fails with EPIPE; if not, the write
lands and the answer read hits EOF.
What the test exists for is that the death is recorded and replayed, which is
orthogonal to which errno won. It now captures whichever cause the first failure
recorded and asserts the later lookup reports that, plus a bound that the
cause came from the pipe at all (
UnexpectedEof | BrokenPipe) — without which"sticky" would be satisfiable by an unrelated failure.
3.
daemon_log_file_escaping— and a real divergence behind itThe test failed at its own non-vacuity guard, not at an assertion. #7633
stopped writing the client argument vector to the daemon log — correctly,
upstream never writes it at all — and that vector was this test's only subject.
Re-pointing it at a vector oc does log measured a live divergence. Upstream
escapes in the sink:
logit()is the only writer oflogfile_fpand handsevery line to
filtered_fwrite(...)(log.c:126-132), so no call sitepre-cleans its operands, and
clientserver.c:787passes the module namestraight through. oc ports
filtered_fwritefaithfully — but seven daemon logbuilders wrapped the module name in
sanitize_module_identifierfirst, whichreplaces control characters with
?.Measured on a module named
A<ESC>Brequested over a raw@RSYNCDhandshake,master writes both renderings into the same log file:
The second line is already correct —
client_args_log_linedoes not sanitise,so the sink escapes reversibly. The first is lossy:
?cannot be undone, and areader cannot tell an escaped byte from a literal question mark.
The sanitiser call is removed from all seven builders and deliberately kept
on the wire
@ERRORreply path, a different sink with no escaping layer of itsown. One doc comment that claimed the name was "sanitised to strip control
chars" — true when written, false after this change — is corrected in the same
commit.
Not covered, and said so in the test header: an unresolvable module name.
Upstream logs those too (
clientserver.c:1568), but oc opens a log sink onlyper resolved module, so nothing before module resolution reaches a log file at
all. That is a real separate gap, recorded rather than papered over.
Verification
RUSTDOCFLAGS="-D warnings" cargo doc -p fast_io --no-depscleanon a default build (the configuration the gate builds).
fails on the mangled-form assertion and prints both disagreeing lines.
cargo fmt --all -- --checkclean.