Repository navigation
test(daemon): provoke the session error with a non-UTF-8 request line - #7615
Conversation
`session_error_does_not_stop_the_accept_loop` fails on master. The fixture
provoked its session error by sending the `@RSYNCD:` version banner twice,
relying on the second banner re-driving `Greeting -> ModuleSelect` from
`ModuleSelect` and being refused by the connection FSM.
The daemon no longer refuses it. `session_runtime.rs` deliberately treats a
second banner as a module name, citing clientserver.c:1534-1538: upstream reads
the version line exactly once, and the next line is the request whatever it
contains. Its comment states the reason - taking the FSM edge again would be a
session error, and a session error is fatal to the whole listener, so a peer
could end the daemon with two greeting lines. That arm is correct and stays.
The two commits are individually right and mutually contradictory. The arm
merged at 14:09 and the test at 16:39 the same day, but the test's branch was
never rebased onto the arm, so the two never ran together until both were on
master.
Re-point the provoker at an error the daemon still raises: a request line that
is not valid UTF-8. The daemon reads it with `BufRead::read_line` into a
`String`, which fails with `InvalidData`. That is not a connection-closed kind,
so `report_session_failure` logs it rather than treating it as a normal close,
and the accept loop must still serve the second client.
The failing assertion was the fixture's own non-vacuity guard, whose comment
predicted exactly this ("if the daemon ever starts answering a repeated banner
cleanly this fixture stops provoking anything"). It is kept as-is, and the log
assertion now names the new cause so a future divergence fails loudly instead
of passing while proving nothing.
Verified on macOS: RED on pristine master with the reported assertion, GREEN
after. Mutation-proven - restoring a valid-UTF-8 request line reddens it again
(`got ["@error: Unknown module 'nosuchmodule'"]`), so the fixture genuinely
depends on the non-UTF-8 byte.
|
Correction to my own blast-radius claim: it is every open PR, not the seven I listed. I earlier classified affected PRs by whether their head carries both A head that does not contain the test cannot fail it — unless the tested tree is not the head. It is not:
The cell set is also wider than the two I named. Both corrections make the case for the fix stronger, not weaker: the mechanism, the root cause and the fix in #7615 are unchanged — only my estimate of who is affected was too narrow. |
|
Independently reproduced and verified on macOS (aarch64, stable), against master RED on master, before this PR: GREEN with only this PR's test file applied, production code untouched at master: Two things this adds beyond the write-up:
Worth stating plainly for anyone triaging the board: this is not "master is broken and #7579/#7590 are contradictory." Both landed commits are individually correct; the test fixture simply lost its ability to provoke once the daemon's banner handling became upstream-faithful. Merging this restores real signal to the cell rather than suppressing it. ⚠ One caveat on my verification: macOS only, and the daemon cell is Linux-relevant too. It establishes the fixture logic is right; it does not substitute for the Linux cells in this PR's own run. |
#7620) `session_error_does_not_stop_the_accept_loop` fails on every Linux cell of every open PR, and its assertion discards the evidence needed to diagnose it: first client must be dropped mid-session, not answered; got ["@error: Unknown module '@rsyncd: 32.0 md5 md4'"] That names the symptom - the daemon answered the client's VERSION line as if it were the module request - and then throws away everything that identifies which line the daemon read first: the greeting the provoker actually received, the daemon's own log, and both peers' results. The assertion two blocks above it already carries `log_contents`; this one, the one that actually fires, does not. It is not deterministic. #7615's own `nextest (stable)` was SUCCESS on this exact merge commit, and it fails on other PRs' merge commits with the same base - so it is a flake that reproduces only in CI. 65 local runs across five regimes on an aarch64 Linux host all pass: 3x alone (default features), 6x alone (--all-features), the parallel package run, 24-way concurrent, and 32-way pinned to a single CPU. No x86_64 Linux host is reachable to run the real cell (`--workspace --all-features`, 33482 tests), so the next CI failure is the only instrument available - and it has to carry more than it does now. Two changes, both test-only: 1. `run_provoker` returns a named `ProvokerOutcome { greeting, trailing }` instead of a bare `Vec<String>`. The greeting was read and dropped; it is the control for "did the daemon speak first at all", which is precisely the question the failure raises. 2. The non-vacuity assertion reports the greeting, the trailing lines, both results and the daemon log. Nothing about the property under test moves: the same condition is asserted on the same value. Verified: the diagnostic is non-vacuous - mutating the predicate to `false` makes it fire and print the greeting (`@RSYNCD: 32.0 sha512 sha256 sha1 md5 md4`), both results, and the full daemon log including the `failed to serve legacy handshake ... stream did not contain valid UTF-8` line. Restored, re-run, green. `rustfmt --edition 2024 --check` clean.
`## [Unreleased]` last covered the #7304-#7522 era. Measured against the 60 most recently merged pull requests, 44 were absent; of the most recent 45, 43 were absent. Nothing from #7574 onward was recorded at all. Each entry is derived from what the pull request actually landed - the merge commit and the body - not from its title. Three cases where those differ: * #7616 ships far more than the doc-alias correction its body describes: the `upstream_version` pin moves to 3.5.0 and `--version` starts naming `quic`, `sd-notify`, `vmsplice` and `send_zc`. * #7618 also adds the pull-request rustdoc-link job its body says was filed separately, which is what closes the master-only-gate recurrence. * #7602's squash carries the closed #7597 as its first commit, so the directory-obstacle half is recorded under #7602. #7587 is deliberately not recorded. Its merge commit is empty: the change had already landed as #7563, which the section already names. Entries extend the existing Keep a Changelog groups and the bold sub-groupings. Clusters that are one story carry one entry with several references: the FERROR_XFER routing and its two-phase drain (#7576, #7581), the connection-FSM close edge and the accept loop that outlives a session error (#7579, #7590), the three detaching daemon suites (#7578, #7588, #7592), the io_uring and SEND_ZC work (#7593, #7600, #7610), the citation retargets (#7601, #7603, #7604), and the accept-loop pin flake (#7615, #7620). Only `## [Unreleased]` is touched; every released section, including the 3.4.4 statements that were correct when written, is byte-identical.
session_error_does_not_stop_the_accept_loopfails on master, and on every open PR whose base carries both of the commits below. It is not caused by any one PR.Mechanism
run_provokersends the version banner twice in one write:Line 2 was meant to re-drive
Greeting -> ModuleSelectfromModuleSelectand be refused by the FSM, producing the session error the test needs.The daemon no longer refuses it.
session_runtime.rsdeliberately treats a second banner as a module name:So the daemon answers
@ERROR: Unknown module '@RSYNCD: 32.0 md5 md4'— exactly the string the failing assertion reports.Why it landed green
34b49e9cdthe fallthrough arm7e2d9391athe testThe arm merged first, but #7590's tested head (
53d155c07) does not contain it — verified withgit merge-base --is-ancestor. Up-to-date-branch enforcement is off, so the test was validated against a master that still refused the repeated banner. Two individually-correct commits, never run together until both were on master.What this changes
The arm is upstream-faithful and security-motivated — restoring the FSM rejection would revert #7579 and re-open the DoS its comment names. It stays.
Instead the provoker is re-pointed at an error the daemon still raises: a non-UTF-8 request line. The daemon reads it with
BufRead::read_lineinto aString, which fails withInvalidData. That is not a connection-closed kind, soreport_session_failure(workers.rs:82) logs it rather than treating it as a normal close — and the accept loop must still serve the second client, which is the property under test.The module and helper docs now say why a repeated banner cannot be the provoker, so this does not get re-introduced.
The guard did its job
The assertion that fires is the fixture's own non-vacuity check, whose comment predicted this exactly:
Without it the transfer assertions would still have passed and the test would have gone quietly inert. It is kept unchanged; only the log assertion is re-pointed at the new cause.
Verification
first client must be dropped mid-session, not answered; got ["@ERROR: Unknown module '@RSYNCD: 32.0 md5 md4'"]— the CI failure reproduced locally, independent of CI.1 test run: 1 passed.got ["@ERROR: Unknown module 'nosuchmodule'"]), so the fixture genuinely depends on the non-UTF-8 byte rather than passing for free.cargo fmt --all -- --checkclean. Test-only change, 1 file, +21/-11.Blast radius
Measured across the open set, these carry both commits and are affected: #7614, #7613, #7612, #7611, #7607, #7598, #7588. Only #7588's feature-flag cells had finished at diagnosis time; #7611 and #7598 had them still in flight. No PR anywhere shows SUCCESS on those cells while carrying both commits.
⚠ nextest fail-fast truncated the CI runs, so one failing test there is a lower bound, not the failure set.