8000 fix(xerj-autoindex): a retrying request announces itself (#1183 item 1) by xerj-org · Pull Request #1199 · xerj-org/xerj · GitHub
[go: up one dir, main page]

Skip to content

fix(xerj-autoindex): a retrying request announces itself (#1183 item 1) - #1199

Merged
xerj-org merged 2 commits into
mainfrom
fix/silent-retry-envelope
Oct 7, 2026
Merged

xerj-org merged 2 commits into
mainfrom
fix/silent-retry-envelope

Conversation

@xerj-org
@xerj-org xerj-org commented Oct 7, 2026
Copy link
Copy Markdown
Owner

What

The retry loop in the autoindex ES client announced HTTP 429 waits (throttle_notice) but said nothing for transport errors and 5xx. This adds the symmetric failure_notice: a loading run (announce on) now prints

autoindex: search failed: <reason, one line, capped>; retrying (attempt 2 of 6, 310 s in this request so far)

on the first failure and at most once per NOTICE_EVERY (30 s) after, sharing the 429 notice's clock so an alternating 429/timeout sequence cannot double-announce. Probes, MCP clients and --quiet stay silent — no output-shape change for any non-loading caller.

Why: the #1183 "deadlock" was not a deadlock

The incident report ("finalize-catalog deadlocks — all 297 threads futex-waiting", rc.83 fresh build) re-examined against the client code:

The defect that made a bounded wait look like a deadlock was the silence. This PR fixes the silence. The issue's own minimum ask — "the phase should time out and report rather than hang" — was already satisfied on the timeout half; this lands the report half.

One honest unknown, not guessed at

The incident's items=34/1479 finalize-catalog total implies ~1.5 M sweep paths, which is not reconcilable with the corpus's actual duplicate set (58 008 files across the six repos, ≤ ~3.6 k duplicates ⇒ ≤ 4 chunks), and the journal that produced it is gone. The standing --fresh rebuild (fresh journal, empty plan) will pin the real number when it reaches finalize; the tracker comment records the discrepancy rather than papering over it.

Tests

  • failure_notices_announce_immediately_then_hold_the_cadence — the gate: a quiet client never announces nor marks the clock; a loading run announces the first failure and holds the cadence on the immediate next.
  • a_dropped_connection_is_retried_after_announcing — the wire shape: read-then-drop ⇒ transport failure ⇒ announce + retry ⇒ 200.
  • Crate suite 1267 passed / 0 failed, clippy clean, fmt applied.

Notes

The rc.83 "finalize-catalog deadlock" was not a deadlock. Diagnosis, from
the incident's own evidence re-read against the client code:

- The client's retry envelope was always bounded: every request carries a
  300 s total timeout (esclient.rs:856, present since the #977 port), and
  retry_loop gives a request six attempts before handing the error back —
  ~31 min worst case, then the caller's own downgrade path takes over (for
  the alias sweep that is the #345 non-fatal warning, by design).
- "All 297 threads futex_do_wait, two in ep_poll, zero CPU" is exactly the
  signature of reqwest::blocking: the caller parks on a oneshot (futex)
  while the client's internal tokio runtime polls (ep_poll). wchan cannot
  distinguish parked-awaiting-HTTP from parked-on-a-condvar at that
  granularity, so a bounded silent wait read as a lock cycle.
- since_progress_s=430 > 300 confirms the loop was cycling: attempt 1
  timed out at 300 s, the backoff ran, attempt 2 was in flight when the
  diagnostics were captured.
- The server-side half stays open: the reference node runs at/over its
  parent memory breaker during xerj-search rebuilds (measured 2026-10-06:
  rss 22.5 GB against a 16 GB limit, writes 429'd for 600 s+), and one
  read stalling past the 300 s window under that pressure is consistent
  with everything captured. Tracked with the #1122 memory-ceiling class.

The defect that made it LOOK like a deadlock was silence: the retry loop
announced 429s (throttle_notice) but nothing at all for transport errors
or 5xx. This adds failure_notice on the Attempt::Failed arm — first
failure prints immediately ("autoindex: search failed: <reason>; retrying
(attempt 2 of 6, 310 s in this request so far)"), then at most once per
NOTICE_EVERY, sharing throttle_notice's clock so alternating 429/timeout
cannot double-announce. Same announce gate: loading runs speak; probes,
MCP clients and --quiet stay silent — zero output-shape change for any
non-loading caller.

The incident's 1479-item finalize-catalog total (implying ~1.5 M sweep
paths) is not reconcilable with the corpus's actual duplicate set (58 008
files, ≤ ~3.6 k duplicates -> ≤ 4 chunks) and the journal that produced it
is gone; the standing --fresh rebuild (b1791330708, fresh journal, empty
plan) will pin the real number when it reaches finalize. Noted in the
tracker comment rather than guessed at here.

Tests: failure_notices_announce_immediately_then_hold_the_cadence pins the
gate (quiet never announces nor marks the clock; a loading run announces
the first failure and holds the cadence on the next); a_dropped_connection_is_retried_after_announcing
pins the wire shape (read-then-drop -> transport failure -> retry -> 200).
Crate suite 1267 passed / 0 failed, clippy clean, fmt applied.

Reference-coding: skipped — the change is confined to this repository's
own client (a stderr notice inside our own retry loop); the transport
precedent for the retry policy itself is already cited in-file
(quickwit/meilisearch, esclient.rs BulkAdmission header).
@xerj-org
xerj-org merged commit f6dce3d into main Oct 7, 2026
22 checks passed
neoneye pushed a commit to agent-memory-atlas-archive/xerj-org--xerj that referenced this pull request Oct 10, 2026
The corpus-index trust window. Four PRs, all against the corpus ingest
path the rc.84-86 honesty work exposed:

- xerj-org#1195 (merged just past the rc.86 tag): phase-B bulk bodies coalesce
  across files — the per-file round-trip ceiling of xerj-org#1147 (xerj-org#10^5
  records/node-day on the ghsa-scale mirror class). A/B'd, no
  regression: rustsec 10.1s -> 9.7s, pysec 17.4s -> 16.9s, phase B at
  parity on both shapes; the structural win shows at scale, which the
  standing corpus rebuild re-measures.
- xerj-org#1197: `xerj corpus index` proves the store answers a search before
  printing "searchable" — the xerj-org#1183 resume that certified 642 records
  over a store answering every _search with store_exception. An
  unsearchable build is retired by exact name, not switched in.
- xerj-org#1199: a retrying client request announces itself (xerj-org#1183 item 1's
  client half) — the retry envelope was bounded (6 x 300s) but silent,
  which is exactly how it read as a deadlock. The server-side stall
  under memory pressure stays open in xerj-org#1183 with the xerj-org#1122 class.
- xerj-org#1200: JSON records with no prose gain a synthesized text passage,
  plus a plan-time warning for any dataset mapping no text-searchable
  field — the build-time half of xerj-org#1158, whose query-time half shipped
  in rc.86. The issue closes with both halves shipped.

ROADMAP rolled to the rc.87 cut: nine open at the cut (xerj-org#1147 and xerj-org#1158
closed inside the window), the rc.86 and earlier records stand as
written. Release-notes gate: PASS locally.

Files: engine/Cargo.toml (version stamp), CHANGELOG.md ([Unreleased]
cut into [1.0.0-rc.87]; the xerj-org#1147 entry written at this roll — the PR
merged past the tag, so its entry lands here), ROADMAP.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0