Skip to content

docs(observability): cite the saturation ticker by symbol, not a buffer-pool span - #1533

Merged
FlorentinDUBOIS merged 1 commit into
mainfrom
docs/saturated-seconds-citation
Sep 25, 2026
Merged

FlorentinDUBOIS merged 1 commit into
mainfrom
docs/saturated-seconds-citation

Conversation

@FlorentinDUBOIS

@FlorentinDUBOIS FlorentinDUBOIS commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1531.

The defect, and why it is not "a number is wrong"

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 about fifteen lines further down, in the block guarded by
ACCEPT_SATURATION_TICK that carries incr!(names::accept_queue::SATURATED_SECONDS).

Every gate passed on it, each for a defensible reason:

  • Rule 1 is satisfied: the cited lines resolve and are not blank.
  • Rule 2 has nothing to compare: the cited text never changed. docs(rate-limit): record that a failed backend dial keeps the per-(cluster, IP) slot #1528 re-anchored the number
    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.
  • --audit reports 7 findings on this tree and this was not among them — it declined both
    spans 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_TICK block of Server::run instead 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 defensible
here. 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 declaration
and 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.md was extracted by driving the check script's own citations() /
resolve_path()
, not by a hand-rolled parser — 13 citation groups, 18 spans — and each span's
source 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 separate
spans, 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.

Citation What the prose claims What the span actually was Verdict
https.rs close path "the close path uses write-only shutdown on the front socket", with a fence quoting front_socket.shutdown(Shutdown::Write) the tail of the failed-upgrade branch plus cancel_timeouts / state.close — a branch whose own comment says front_socket is unreachable wrong → now cites the Shutdown::Write block of HttpsSession::close
http.rs mirror same claim, "mirrored in" entirely inside the same failed-upgrade branch wrong → now cites HttpSession::close
server.rs SoftStop/HardStop "the SoftStop / HardStop verbs" straddles two functions — the tail of the previous one plus the header of the dispatching one — and contains neither verb wrong → now cites Server::read_channel_messages_and_notify

The 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 — "the Shutdown::Write
block 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 / 496 for the two ALPN refusal counters, and the tcp.rs Shutdown::Both
pair — each land exactly on the incr! or the comment the bullet names. So do section 3.2's
accept-queue symbols, the 90% unwind span, the ALPN match, the config validator pair, and the
mux::connection module-doc citation.

3. Can --audit catch this class? Measured — and closing the item

The candidate is not a new rule. --audit already carries the exact signal the issue describes:
the prose names a symbol that is not there. It stayed silent because of audit_fragment, not
because 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 test and were never examined. So the real question is
whether to widen the prose window, and that was measured at 00118f77 against the mode's
shipped baseline of 7 findings / 81 examined:

Variant Findings vs baseline Real defects among the additions
shipped 7 — —
always read one line above (keeping the nearest-symbol picker) 13 +6 / −0 1 of 6
any identifier the surrounding prose names — the issue's literal rule 17 +13 / −3 2 of 13
both, over a whole blank-line-delimited block 26 +23 / −4 2 of 23

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 in
audit_symbol's docstring as the reason the nearest symbol is read — and a block-wide window adds
two new structural ones, merging adjacent markdown table rows and reading a fenced block's rust
info string as a prose symbol.

Two further findings worth recording:

  • Even the minimal widening reaches only one of the two sites, for a reason unrelated to the
    window: at the metric-inventory citation, audit_symbol walks back onto SessionManager::decr,
    whose last segment is four characters, and returns None rather than continuing to
    check_limits. A second, independent silencer.
  • The variants that do fire on it fire by a one-line margin. AUDIT_WINDOW is 8; the wrong
    span 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::timeout again — proximity cannot tell "the name is
    nearby" 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.py is 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 been
sitting in the bucket the mode cannot read. A symbol needs no window.

Verification

Documentation only — git diff --name-only against the fork point lists
.github/scripts/check_doc_citations.py, CHANGELOG.md, doc/README.md and
doc/lifetime_of_a_session.md, and zero .rs files; the script diff contains zero non-comment
lines. On that proof the sozu-e2e re-run is skipped. Everything else was run and read by exit
code, 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 223a4511 and --audit --root . all
exit 0; the audit reads 7 findings / 80 examined / 90 declined, unchanged in findings and five
lower in declined.

…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
FlorentinDUBOIS merged commit 8bf2532 into main Sep 25, 2026
51 of 52 checks passed
@FlorentinDUBOIS
FlorentinDUBOIS deleted the docs/saturated-seconds-citation branch September 25, 2026 16:38
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.

doc/lifetime_of_a_session.md cites buffer-pool code as evidence for the accept_queue.saturated_seconds ticker; stable, resolvable and wrong

1 participant