Skip to content

docs(architecture): record the bounded report readers - #686

Merged
kirillDevPro merged 1 commit into
mainfrom
docs/report-reader-budget
Sep 21, 2026
Merged

kirillDevPro merged 1 commit into
mainfrom
docs/report-reader-budget

Conversation

@kirillDevPro

Copy link
Copy Markdown
Collaborator

What & why

docs/ARCHITECTURE.md still described report reads as an unbounded connection that always attached the companion databases. Since that section was last touched, readers take a process-wide permit (eight slots, wait up to three seconds), AttachSet decides which databases a query attaches, and SQLITE_CANTOPEN is classified as retryable FailKind::Exhausted rather than a settled empty or corrupt result. On Unix, startup raises the soft RLIMIT_NOFILE to the hard limit (capped at Darwin OPEN_MAX on macOS) after the logger and before the install's own stores open.

The new "Report readers" subsection states that contract, including the cases that are outside it: a superseded wait is FailKind::Other, the uid-floor probe and the integrity scan do not take a slot, a missing or unhealthy companion attaches nothing, and a --fixture run can open the relocated replica before the limit is raised.

How to verify

Checked against db::open_reader_with, db::reader_budget, read_fail::classify, AttachSet, CHART_TRADE_HISTORY_ATTACH, valuation::attach, analytics::attach_strategies, the integrity scan's bare read-only open, and startup::open_file_limit. A separate read of the first draft rejected several absolute claims (a ninth reader always fails, CANTOPEN means the descriptor budget, valuation silence, nine descriptors unconditionally, every database open happens after the raise); the text now matches those call sites. Markdown only — no Rust, so cargo fmt and cargo test are not required.

Left for a later pass: the data-path section still names chartdx::trade_history_sync::trade_mark (the function is trade_mark_with), and docs/PRODUCT_MAP.md still says Ctrl+Shift+wheel super-stretch is absent.

The architecture still described report reads as an unbounded open.
Readers now take one of eight permits, attach companion databases
per query, and classify CANTOPEN as retryable exhaustion. Unix
startup raises the soft open-file limit before the install's own
stores open.
@kirillDevPro
kirillDevPro merged commit cd26594 into main Sep 21, 2026
8 checks passed
@kirillDevPro
kirillDevPro deleted the docs/report-reader-budget branch September 21, 2026 21:22
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.

1 participant