Skip to content

fix(api): keep health responsive during lake reads (#1067) - #1077

Merged
athvin merged 3 commits into
mainfrom
issue/1067-readiness-reads
Nov 10, 2026
Merged

athvin merged 3 commits into
mainfrom
issue/1067-readiness-reads

Conversation

@athvin

@athvin athvin commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Closes #1067

Claimed by Codex at 2026-11-10T17:59:13.019218+00:00; session 01a1be1a-66a7-72f3-8e78-32c20c5e0da9 on Mac-87.lan. This open draft PR holds the claim.

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

Keep health and readiness responsive while dashboard requests wait on synchronous lake I/O.

Why

A synchronous DuckDB catalog wait inside an async handler stalls the executor, including literal liveness. The new local socket-boundary regression failed on the original metrics path with both probes timing out; the fix passes metrics, data-quality and runs without loosening probe deadlines.

Proof

Regression observed red (metrics blocked health/readiness, both false) and then green for all three dashboard routes. Capacity/cancellation and worker-panic tests pass. Local make check and full make check-e2e pass. CI run 42873390606 and all 15 exact-head required contexts pass at 8b22b09. The first local integration attempt hit an unrelated concurrent CSV fixture collision, tracked in #1078; the complete retry passed. Live acceptance passed; the 30-minute watch and ledger are closed.

Risk & rollback

Dataset read-session concurrency is bounded to two per process; excess requests await capacity, so lake response latency may rise under load while unrelated requests remain responsive. Permits stay with running work after client cancellation. Tag metadata is fetched asynchronously before duplicate-group lake reads; unmerge writes remain after the read closure returns owned pairs. Revert the merge commit to restore the old execution placement.

Post-merge ledger

Closed by: Codex · session 01a1be1a-66a7-72f3-8e78-32c20c5e0da9 on Mac-87.lan · 2026-11-10T18:58:47.558166+00:00

  • main is green with this change on it — a7395900dd442d72e950bd505502b8ce642dc652; rust 42875375767, frontend 42875375699, infra 42875375594 and devcontainer 42875375688 all succeeded.
  • images — 42875375968 succeeded; er-api built, unchanged er-web correctly reused.
  • deploy converged — 42875998618 succeeded in dev/prod and logged the exact merge SHA. Production retired green at 18:36:13Z after three healthy minutes. Read-only live verification: service selects blue pod web-api-blue-784c6c8c96-z6f5x, both containers ready with zero restarts. Its API emitted er-server listening at 2026-11-10T18:31:58.680572Z; web emitted Ready in 0ms. The only warning was the expected initial web startup connection refusal at 18:31:59Z, before cutover; no subsequent readiness warnings observed.
  • the push-only surface — deploy succeeded; baseline drift 42765804246 is green. Nightly kind 42770567413 was already red before this change (token_hash absent from public task response); nightly coverage 42772861654 and mobile Safari 42772654562 also predate this branch. No new failure attributed to this change.
  • the board card — Fix production readiness timeouts during dashboard reads #1067 is CLOSED and project 2 Status Done; GraphQL closure actor is PullRequest fix(api): keep health responsive during lake reads (#1067) #1077. No manual Done edit.
  • follow-ups — unrelated local dictionary fixture collision tracked in test(cli): isolate concurrent dictionary fixtures with unique temporary files #1078. Existing production TLS/mail/SNS/WAF items remain open separately.
  • what was learned is written down — er-server-control-plane/SKILL.md now requires the full synchronous session lifecycle inside bounded blocking work; cancellation holds capacity until the worker ends.

Specific to this change

  • Live acceptance and watch — normal login plus metrics/data-quality/runs passed Chromium and WebKit at 18:36Z and again at 18:56Z, returning 23 synthetic records with zero page errors. From merge at 18:27:23Z through 18:58:01Z, 368 independent public-health samples all returned HTTP 200/ready=true; 262 were after deployment (maximum 0.932s). The active pod remains 2/2 ready, zero restarts, and no post-startup warning events. All main runs in the window succeeded. Evidence: .tools/prod-1067-health.jsonl, /tmp/er-1067-browser-{after,final}.log, /tmp/er-1067-final-{pod,events}.json on Mac-87.lan.
Context — plan, discoveries, measurements, files

Plan — completed

  1. Reproduce a blocked DuckLake catalog read concurrently with anonymous health/readiness on a single async worker, in the existing Postgres integration harness. Observe the regression fail before implementation.
  2. Move the dashboard lake session lifecycle (open, queries, drop) into bounded blocking work while preserving authorization, response contracts and the request trace. Audit adjacent lake-read handlers for the same issue.
  3. Run the regression, existing lake-read/isolation integration tests, make check and make check-e2e. Preserve failure evidence and the final implementation rationale here.
  4. Land through land-pr; observe a production dashboard navigation alongside public health, verify the new process, and close the post-merge ledger only with the results.

Discoveries

  • The shared async helpers returned synchronous sessions to 24 handlers/advisory paths. They are replaced by with_dataset_lake, which creates, reads and drops the session within lake_reads::run; er_obs::spawn_blocking_in_span preserves request trace context.
  • The regression uses a real PostgreSQL-backed control plane and DuckDB attach to a held local catalog socket. The observer runs on an OS thread, so a blocked Tokio clock cannot falsely pass the health deadline.
  • Baseline main 7cad4ad9 already has nightly failures: coverage42772861654 (DuckDB source extraction DirectoryNotEmpty), frontend42772654562 (mobile Safari marketing range keyboard assertion), kind42770567413 (probe assumes removed public token_hash field). These precede this branch and must not be attributed to this diff. Logs retained in /tmp/er-baseline-<run>.log on the session host.
  • AWS SSO renewal was initially needed and subsequently verified; independent pod/process checks completed. No production state was mutated directly.

Measurements

  • Production trace counters for the 18:35Z browser interval: 144 ended spans and 144 exported spans; no reported export-failure datapoint. This verifies the current process, not resolution of intermittent exporter issue Reproduce and fix intermittent per-boot span-export silence #987.

  • Post-deploy normal sign-in passed Chromium (18:36:27–38Z) and WebKit (18:36:39–47Z): metrics/data-quality/runs all HTTP 200, metrics 23 records, zero page errors. Concurrent reads took 4.0–6.3 seconds while independent public health stayed 200 (post-deploy maximum 0.478 seconds through 18:39Z).

  • Before deployment, Chromium and WebKit both completed document navigation to the demo dashboard, read 23 records, and reported zero page errors. Continuous independent public health sampling began at 18:23Z on 2026-11-10.

  • Local logs on Mac-87.lan: /tmp/er-1067-make-check.log and /tmp/er-1067-e2e-retry.log, both exit 0; red/green readiness evidence in /tmp/er-1067-regression-{red,green}.log.

Files

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.

Fix production readiness timeouts during dashboard reads

2 participants