Repository navigation
docs(observability): cite the saturation ticker by symbol, not a buffer-pool span - #1533
Merged
Merged
Conversation
…er-pool span `doc/lifetime_of_a_session.md` cited a buffer-pool gauge block as the evidence for the 1 Hz `accept_queue.saturated_seconds` ticker, in the section 3.3 narrative and again in the metric inventory. The ticker is fifteen lines further down, in the `ACCEPT_SATURATION_TICK` block of `Server::run`; both sites now cite that symbol. The companion span covering the constant's own declaration and doc comment was already correct and is kept as a range. Every gate passed on the defect, each for a defensible reason: the cited lines resolve and are not blank, so rule 1 is satisfied, and the cited text never changed, so rule 2 has nothing to compare — #1528 re-anchored the number faithfully while it was already wrong. A faithful re-anchor of a wrong citation is indistinguishable from a faithful re-anchor of a right one. That is #1447 seen from the other side: there a rule fired on a citation that was correct, here every rule stayed silent on one that is not. The fix is a symbol rather than a corrected number because a number that has survived two faithful re-anchors while wrong is exactly the case the convention exists for. Sweeping all eighteen cited spans in the document by hand found three more of the same class, none of them in the metric inventory, which is clean. The write-only-shutdown pair both landed inside the failed-upgrade branch whose own comment says the front socket is unreachable — the inverse of the claim they support — and now cite the `Shutdown::Write` block of `HttpsSession::close` and its mirror in `HttpSession::close`. The SoftStop / HardStop citation straddled two functions while containing neither verb, and now cites `Server::read_channel_messages_and_notify`. Whether `--audit` can be made to catch the class was measured, and the answer is no. The candidate is not a new rule but a wider prose window on the existing symbol signal, which stayed silent only because the citation sits mid-line under the sentence naming the metric, so both spans were declined rather than examined. Widening reports one real defect per six additions, or two per thirteen for the literal rule the issue proposed, against the six-in-thirteen rate the mode measures for itself and prints in its own banner; the literal rule also silences three correct-citation findings it reports today. The variants that do fire on this citation fire by a one-line margin — the window is eight and the ticker's own comment naming the metric sits nine lines past the wrong span's end. Those numbers, the second silencer behind them and that margin are recorded in `doc/README.md` and in the script's header. The script's behaviour is unchanged; the diff to it is comment-only. Documentation only: no `.rs` file changes. Closes #1531 Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS
requested review from
Wonshtrum and
llenotre
as code owners
September 25, 2026 15:02
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.
Closes #1531.
The defect, and why it is not "a number is wrong"
doc/lifetime_of_a_session.mdcited a buffer-pool gauge block as the evidence for the 1 Hzaccept_queue.saturated_secondsticker, in the section 3.3 narrative and again in the metricinventory. The ticker is about fifteen lines further down, in the block guarded by
ACCEPT_SATURATION_TICKthat carriesincr!(names::accept_queue::SATURATED_SECONDS).Every gate passed on it, each for a defensible reason:
faithfully while it was already wrong, and a faithful re-anchor of a wrong citation is
indistinguishable from a faithful re-anchor of a right one.
--auditreports 7 findings on this tree and this was not among them — it declined bothspans rather than examining them, for the reason measured below.
A citation can be stable, resolvable and wrong at the same time, and stability is all the
existing rules measure. This is #1447 seen from the other side: that issue was a rule firing on a
citation that was correct; this is every rule staying silent on one that is not.
1. Repointed by symbol, not by number
Both sites now cite the
ACCEPT_SATURATION_TICKblock ofServer::runinstead of a span.The convention in this repository carves out a line number for "a specific branch or statement
inside an item", and the ticker is a branch inside
Server::run, so a number was defensiblehere. It is repointed to a symbol anyway, because this particular number had already survived two
faithful re-anchors while being wrong — which is the case the symbol convention exists for. A
symbol cannot drift and needs no audit.
The companion citation on the same sentence, covering
ACCEPT_SATURATION_TICK's own declarationand doc comment, is correct and is kept as a range, unchanged.
2. The sweep — method and result
Method. The sweep was widened from the metric inventory to the whole document, because nothing
about the class is inventory-specific — the defect is "prose names one thing, the span is another",
and that can happen in any sentence carrying a number. Every line-numbered citation in
doc/lifetime_of_a_session.mdwas extracted by driving the check script's owncitations()/resolve_path(), not by a hand-rolled parser — 13 citation groups, 18 spans — and each span'ssource text was printed beside the prose citing it and read by hand. Symbol-only citations were
checked separately by grepping each name in the file it names.
Driving the script rather than reimplementing it is deliberate: its extractor already handles bare
`:NNN`continuations,/- and,-separated groups, the two ends of a range as separatespans, and path resolution that is document-relative before it is repo-relative. A hand-rolled
parser gets some subset of those wrong and reports a confident, wrong total.
Result: three more of the same class, none of them in the metric inventory.
https.rsclose pathfront_socket.shutdown(Shutdown::Write)cancel_timeouts/state.close— a branch whose own comment saysfront_socketis unreachableShutdown::Writeblock ofHttpsSession::closehttp.rsmirrorHttpSession::closeserver.rsSoftStop/HardStopServer::read_channel_messages_and_notifyThe first two are the sharpest form of the class, sharper than the citation this issue was filed
for: the cited lines are the one branch of the close path that explicitly does not do what the
sentence says, and the branch's own comment says so in as many words. Both now use this
repository's own idiom for it, taken verbatim from
http.rs's own comment — "theShutdown::Writeblock of
HttpsSession::close".That is the argument for widening the sweep. The issue scoped it to the metric inventory; the
inventory turned out to be clean, and all three further defects were outside it — including the
strongest instance of the class in the document. A sweep held to the inventory would have reported
"no others" truthfully and found none of them.
The metric inventory itself is clean. Its remaining line citations —
https.rs:466 / 483 / 496for the two ALPN refusal counters, and thetcp.rsShutdown::Bothpair — each land exactly on the
incr!or the comment the bullet names. So do section 3.2'saccept-queue symbols, the 90% unwind span, the ALPN match, the config validator pair, and the
mux::connectionmodule-doc citation.3. Can
--auditcatch this class? Measured — and closing the itemThe candidate is not a new rule.
--auditalready carries the exact signal the issue describes:the prose names a symbol that is not there. It stayed silent because of
audit_fragment, notbecause the signal is missing — the citation sits mid-line under the sentence naming the metric, so
the fragment read is its own line alone, which carries no symbol. Both spans landed in
prose naming nothing this heuristic can testand were never examined. So the real question iswhether to widen the prose window, and that was measured at
00118f77against the mode'sshipped baseline of 7 findings / 81 examined:
Every addition was read and dispositioned. The genuine ones are this issue's two citations and
nothing else. The false positives are overwhelmingly classes the file has already measured out:
a symbol belonging to the adjacent clause or the previous bullet, a symbol that is the sentence's
object further down the span, and a name the cited line is about by absence. Taking every symbol
in the fragment reinstates
expect.rs:219-236/ProxyAddr— the example quoted verbatim inaudit_symbol's docstring as the reason the nearest symbol is read — and a block-wide window addstwo new structural ones, merging adjacent markdown table rows and reading a fenced block's
rustinfo string as a prose symbol.
Two further findings worth recording:
window: at the metric-inventory citation,
audit_symbolwalks back ontoSessionManager::decr,whose last segment is four characters, and returns
Nonerather than continuing tocheck_limits. A second, independent silencer.AUDIT_WINDOWis 8; the wrongspan ends seven lines above the ticker's own comment, and that comment names the metric — so the
name falls outside the window by exactly one line. At 9 every variant goes quiet while the
citation stays just as wrong. The correct companion span is silent for the same reason in
reverse: it opens on the constant's doc comment, which names the metric. Same mechanism, opposite
verdicts, one line apart. This is
Mux::timeoutagain — proximity cannot tell "the name isnearby" from "the item is here".
Decision: close the item, do not ship the rule. One real finding in six additions, or two in
thirteen, against the six-in-thirteen rate this mode measured for itself and prints in its own
banner. Shipping either would change that banner's honest promise from "expect roughly half of
this to be wrong" to "expect roughly five in six", and the literal rule additionally silences three
correct-citation findings it reports today. A gate people learn to skip is worse than no gate.
check_doc_citations.pyis therefore unchanged in behaviour — the diff to it is comment-only,recording the measurement in the header the way every other constant in that file carries the
measurement that chose it.
doc/README.md's audit section carries the reader-facing version.What actually fixed it is the remedy the file already recommends: the five misaligned spans
became symbols, and
--audit's declined count fell from 95 to 90 — every one of them had beensitting in the bucket the mode cannot read. A symbol needs no window.
Verification
Documentation only —
git diff --name-onlyagainst the fork point lists.github/scripts/check_doc_citations.py,CHANGELOG.md,doc/README.mdanddoc/lifetime_of_a_session.md, and zero.rsfiles; the script diff contains zero non-commentlines. On that proof the
sozu-e2ere-run is skipped. Everything else was run and read by exitcode, at the rebased base
223a4511:cargo build·cargo +nightly fmt --all -- --check·cargo clippy --all-targets -- -D warnings·
cargo test -p sozu-lib(1134 passed) ·cargo test -p sozu·cargo test -p sozu-sim·cargo clippy -p sozu-sim -- -D warnings·RUSTDOCFLAGS="-D warnings" cargo doc·cargo bench -p sozu-lib --bench h2_stream_table -- --test— all exit 0.check_doc_citations.py--self-test,--root .,--base 223a4511and--audit --root .allexit 0; the audit reads 7 findings / 80 examined / 90 declined, unchanged in findings and five
lower in declined.