Repository navigation
appview: log the cause, repo and seq of per-event relay-firehose errors - #262
Conversation
@atproto/sync wraps every parse/auth failure in a generic 'error in parsing and authenticating firehose event'. We logged only err.message, so when that line flooded the AppView log on 2026-11-30 (alongside a heap OOM every ~2.5h) there was no way to tell what was failing or for which repos. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
🚅 Deployed to the cocore-pr-262 environment in co/core
4 services not affected by this PR
|
🛠️ Provider build (macOS arm64) — menu-bar app + CLIBuilt from 🔌 Pre-wired to this PR's stack — the app defaults to ⬇️ cocore-mac-arm64-pr262-1f29072.tar.gz (GitHub artifact — requires being signed in to this repo. The zip contains the tar -xzf cocore-mac-arm64*.tar.gz && cd cocore-mac-arm64
./install.sh # installs cocore.app to /Applications + the CLI, launches the tray
CLI only? It's wired to this PR's stack too: ./bin/cocore agent pair --console https://client-cocore-pr-262.up.railway.app
./bin/cocore agent serve --advisor wss://advisor-cocore-pr-262.up.railway.app/v1/agent |
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Why
On 2026-11-30 the AppView ran out of Node heap (~3.9 GB) seven times in 17 hours, in both production and dev, and exhausted Railway's 10 restart retries. The acceleration from a weekly OOM to one every ~2.5h coincided with a flood of this log line, dozens per second:
That message is the generic wrapper
@atproto/syncputs around every parse/auth failure. The real failure is onerr.cause, and the raw event is onerr.event, but we logged onlyerr.message— so the log cannot say whether these are bad signatures, failed DID lookups, or something else, or which repos they come from.What
describeRelayError(err)builds one line: message,cause=<name>: <message>, and for parse errorsrepo=<did> seq=<n>.onErrorhandler logs that instead oferr.message.No behaviour change beyond the log line. Subscription-level errors still re-throw into the supervised reconnect as before.
Not in this PR
This does not fix the leak. It is the diagnostic needed to find it. Log volume per line grows, at the same line count.
Testing
vitest run src/indexer/relay-firehose.test.ts— 6 passed (3 new)tsc -p . --noEmitinpackages/appview— clean🤖 Generated with Claude Code