Skip to content

docs(manual): qualify database-unavailable reporting expectations - #4180

Merged
yannickmonney merged 1 commit into
mainfrom
docs/qualify-database-unavailable-reporting
Oct 3, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
docs/qualify-database-unavailable-reporting

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What changed

Qualify the manual DATABASE_UNAVAILABLE row as per-request suppression, not silence throughout an outage. Name the intended once-per-outage SSE warning (60-second default threshold, recovery reset) and fatal boot report after the bounded database retry budget expires. Runtime and browser filters stay unchanged.

Swept nearby manual references and EN/DE/FR observability pages: PERF-B5/PERF-B7 and all three translations already distinguish these intended reports; no duplicate edits needed.

Verification

  • bun run lint:manual: passed, 5 trees / 1438 boxes.
  • bun services/platform/tests/manual/scripts/check-guide.ts services/platform/tests/manual/suites/performance.md: passed (referenced suite; none changed).
  • git diff --check: passed.
  • Scoped repo-pinned oxfmt 0.64.0 check: Markdown intentionally excluded by configuration; no matching files.
  • Local source-extracted synthetic watcher check: quiet at 59,999 ms, warning at 60,000 ms, no repeat during the outage; recovery resets the threshold and allows one new report. Transient recovery stays quiet. Evidence script and logs attached to TALE-431.
  • Existing automated proof: services/platform/backend/realtime/sse.test.ts:301 (short outage resumes quietly) and :338 (one threshold warning across multiple streams). Synthetic check supplements this with explicit recovery-reset proof.
  • No dependencies installed, runtime/TypeScript edits, production probes, stack/browser/container/E2E testing. Typecheck not applicable to Markdown-only patch; full gates run in CI.

Closes #4044

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent review of PR #4180 at 3626b56e523f8f2b2267da5d0c9e15eee4743c6b: accepted, with one LOW wording point and one nit (neither blocks merge).

  • Reviewer: Tale agent optimize rag action #4 5f5307c9-4cbd-416a-a456-8bb667fc584d, TALE-510 run 0f5ab677-d2e3-4b82-aae6-340caace7c85 (review slice from fleet-manager run 0859f54c-2205-4c96-8185-1a71525f4957).
  • Implementation: Codex Sol-6.1 add --chat-max-width CSS variable #3 4c7208dc-bd24-4dff-9701-6046d19d295d, TALE-431 run c78cf9c7-ac5e-45cf-915d-d106f50e87ab. The agents and runs are distinct. The GitHub principal is shared, which is why this is a comment and not an approving review.
  • Scope: a light review covering source, docs and CI evidence. I started no stack or browser and ran no tests. The diff is one line: services/platform/tests/manual/reference/error-codes.md:211. Its merge base is 7063f9974. It merges cleanly onto main 20b6d441b, whose 4 newer commits don't touch the reviewed code or docs.

Contract checks against the source at this head

Check Result Evidence
Row qualified as per-request ✅ The row now says "These individual 503 failures do not reach SENTRY_DSN … This is per-request suppression, not silence for the whole outage". The 503 is answered before reportRequestError (backend/rest/v1.ts:184-188, backend/error-reporting.ts:361-365) and logged as database unavailable — 503 for … (error-reporting.ts:278).
Sustained SSE outage warning ✅ createOutageWatch (backend/realtime/sse.ts:72-110) sends one reportError(…, { level: 'warning', tags: { 'tale.lane': 'events-poll' } }) per outage (:96). The threshold is ROUTINE_RESTART_MS = 60_000 (backend/db/unavailable.ts:31). recovered() clears since and reported (:102-108) and is called on the first successful poll (:315).
Exhausted startup budget (#4031) ✅ In backend/main.ts, line 237 logs [backend] fatal startup error:, line 238 calls reportError(error, { tags: { 'tale.lane': 'boot' } }) at the default error level, and line 240 exits 1. The bounded wait is runBootMigrations' ROUTINE_RESTART_MS, counted from the first refusal (backend/db/migrate.ts:223).
Runtime and browser filter unchanged ✅ The diff is Markdown only. app/lib/backend/platform-unavailable.ts:14-15 is still exactly UPSTREAM_UNAVAILABLE at 502/503/504 and DATABASE_UNAVAILABLE at 503. It is a code-and-status predicate with no timer, and prepareSentryEvent drops matches at app/lib/sentry-normalize.ts:227.
Cited automated proof exists ✅ backend/realtime/sse.test.ts:301: a short outage is logged and reportError is never called. :338: one warning-level events-poll report across two streams that both wait the outage out.
Sweep: manual ✅ no other overstatement PERF-B5 (suites/performance.md:174-188) already says "no error-level event … a restart longer than about a minute sends one warning-level event". PERF-B7 (:196-208) keeps the fatal startup error log line and the one error-level tale.lane: boot event apart. PERF-B8 (:209-220) and reference/automation.md:114 cover per-request failures only. reference/pins.md:50,52 are history.
Sweep: EN/DE/FR docs ✅ no other overstatement docs/{en,de,fr}/self-hosted/configuration/observability-config.md:71 already names both reports: the one warning-level event from an API process with open live-update streams after about a minute, and the start that fails and is reported as an error. Line 81 of those pages (the browser list), operate/observability/troubleshooting.md:16 and the develop/api-reference.md 503 rows (EN 1331, DE 1389, FR 1649) make no claim about reporting.

What I ran (at this head, unless noted)

  • bun run lint:manual: ok for layout, suites, runs and references (5 trees, 1438 boxes).
  • bun services/platform/tests/manual/scripts/check-guide.ts services/platform/tests/manual/suites/performance.md: OK.
  • The same two checks on a local, unpushed merge of main 20b6d441b and this head: ok (1441 boxes) and OK. Main's own manual changes since the base (automation.md, chat.md, settings.md) don't mention reporting.
  • git diff --check: clean. .oxfmtrc.json ignores **/*.md, so the Format job doesn't cover this row.
  • No workflow under .github/ runs lint:manual, so CI doesn't cover it. The local runs above are the evidence for it.

CI at this head (read about 23:40Z): 63 check runs. 50 succeeded, 12 were skipped and 1 was neutral. None failed or are still running.

  • The skipped runs are 5 Candidate gates, the fork-PR variants of Validate images and Smoke test, the Web, UI docs, AI gateway and Docs container tests, and Backend integration. That is expected for a docs-only diff.
  • The neutral run is Trivy ("10 configurations not found").
  • I don't count skipped or neutral runs as passes.
  • Workflow runs: 37151633593, 37151633605, 37151633607, 37151633609 and 37151633613.

Author claims I did not re-run: the source-extracted synthetic watcher check (quiet at 59,999 ms, a warning at 60,000 ms, reset after recovery) with its logs on TALE-431, and the scoped oxfmt run. The reset itself is plain in sse.ts:102-108.

Findings (none blocks merge)

  1. LOW, wording. The row says the start "reports an error-level fatal startup error (tale.lane: boot)". But fatal startup error is only the console line (main.ts:237). The event (:238) is the database error itself, for example Error: connect ECONNREFUSED … or PostgresError: the database system is shutting down. The backend doesn't promote console.error to events, so a tester won't find an issue with that title in GlitchTip. PERF-B7 already words this correctly. Suggested text: "logs fatal startup error, reports the database error once at error level (tale.lane: boot) and exits (PERF-B7)".
  2. NIT.
    • "the configured threshold (60 seconds by default…)" suggests an operator setting that doesn't exist. app.ts:302 passes no options, so a deployment always uses ROUTINE_RESTART_MS; outageReportAfterMs is a test seam. The wording follows docs(manual): qualify database-unavailable reporting expectations #4044's own text.
    • "open SSE streams" is wider than what the watch sees. Only /events streams feed it. The chat progress lane logs [chat] stream poll failed (domains/chat/routes.ts:1597) and reports nothing. Every app tab holds an /events stream, so the described behaviour is still right in practice.
  3. Coverage note (outside this docs PR). No automated test pins the recovery reset, i.e. that a second outage after recovery reports again. sse.test.ts:301 and :338 cover the quiet short outage and the once-per-outage report. A small sse.test.ts case would close that gap. This is a follow-up candidate, not a condition.

Verdict: accept. The row now matches the code and #4044's expected repair, and runtime and the browser filter are untouched. Items 1 and 2 can be folded in before merge or left as they are. The merge stays with agent #2 (TALE-359) under its contract: re-read the head and checks, then use the protected squash merge with --match-head-commit 3626b56e523f8f2b2267da5d0c9e15eee4743c6b. I made no merge, push or card move.

@yannickmonney
yannickmonney merged commit 29633fc into main Oct 3, 2026
@yannickmonney
yannickmonney deleted the docs/qualify-database-unavailable-reporting branch October 3, 2026 23:49
yannickmonney added a commit that referenced this pull request Oct 4, 2026
* fix(platform): enforce project rights for run controls

Scope project run controls, transcripts and connector-operation approvals to
the project permission rule while retaining organization-level behavior.
Preserve specialized approval kinds and prove the access boundary with
native session/Postgres controls and focused regression coverage.

* fix(sandbox): bound agent execution and recover session state (#4174)

Bound agent replay, retained projections, progress writes and file transfers while preserving authoritative results and explicit recovery failures.

Apply admission to warm activation, reconcile durable session pins and stale Kubernetes capacity, and bound optional Docker/BuildKit preparation. Include regression coverage and operator documentation.

* feat(platform): run GPT-6 models in chat, subscriptions only in tasks (#4181)

* fix(sandbox): release retained command memory and bound stdin (#4185)

Release completed command payloads, disconnected HTTP consumers and tunnel listeners at their lifetime boundaries. Bound held-open stdin to an 8 MiB queue budget while preserving accepted bytes, journal replay and cancellation.

Add Node garbage-collection and backpressure regressions, listener cleanup tests, and matching runtime documentation.

* docs(manual): qualify database-unavailable reporting expectations (#4180)

The manual's DATABASE_UNAVAILABLE row read as if nothing reaches Sentry for
a whole database outage. It now says the 503s are suppressed per request,
names the one warning-level event an API process with open SSE streams
reports once the outage reaches its threshold (60 seconds by default,
reset on recovery), and the fatal startup report after the bounded boot
retry budget, as PERF-B5 and PERF-B7 already describe.

Independently reviewed by agent #4 (review task ff900bde, run 0f5ab677)
at 3626b56; merged by agent #2 (TALE-359 run e72629f1).

Closes #4044
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.

docs(manual): qualify database-unavailable reporting expectations

1 participant