Skip to content

fix(filler): crash instead of idling when a rejection or worker death kills the reader#95

Open
robrigo wants to merge 1 commit into
mainfrom
fix/crash-on-unhandled-rejection
Open

fix(filler): crash instead of idling when a rejection or worker death kills the reader#95
robrigo wants to merge 1 commit into
mainfrom
fix/crash-on-unhandled-rejection

Conversation

@robrigo

@robrigo robrigo commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Why

A statement timeout during AtomicAssetsHandler.init on a cold cache surfaced as an unhandled rejection, and the filler's process-level handlers logged it and stayed up. The process was alive, the reader never started, and Kubernetes had no crashed process to restart, so the filler fell behind at chain rate until a manual pod bounce. The reader stall watchdog never fires for a dead init, and the primary only exits on a worker's explicit failure message, so the same zombie shape existed one level up: a worker dying without that message left the primary running with zero readers and a green /healthc.

Both levels now log and exit non-zero so Kubernetes restarts the pod. The cluster exit listener exempts SIGTERM-initiated shutdowns, and the API server keeps its separate swallowing handlers since a stray rejection there should not take the whole read API down.

Validation

check-types, lint, and the suite are clean: 262 passing, 37 pending, identical to the unmodified baseline (no test exercises bin/filler.ts; the repo has no scaffolding for process-level handler tests and none was invented). The same fix is cherry-picked onto release/1.7 in the 1.7.19 hotfix PR.

… kills the reader

The process-level unhandledRejection/uncaughtException handlers logged and
swallowed, so a startup rejection (a statement timeout in
AtomicAssetsHandler.init on a cold cache) left the process alive with the
reader never started - Kubernetes saw nothing to restart while the filler
fell behind at chain rate. The primary had the same hole one level up: it
only exits on a worker's explicit failure message, so a worker killed by
its own handler left the primary running with zero readers and a green
health check. Both now log and exit non-zero so the pod restarts; a
SIGTERM-initiated shutdown is exempted from the worker-exit escalation.
The API server keeps its swallowing handlers - a stray rejection there
should not take the read API down.
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