Skip to content

fix(indexer): guard recordQuarantinedEvent so bookkeeping failures don't strand events (#120) - #149

Open
ZacLou wants to merge 1 commit into
ourdao:mainfrom
ZacLou:fix/quarantine-record-failure-120
Open

fix(indexer): guard recordQuarantinedEvent so bookkeeping failures don't strand events (#120)#149
ZacLou wants to merge 1 commit into
ourdao:mainfrom
ZacLou:fix/quarantine-record-failure-120

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 3, 2026

Copy link
Copy Markdown

Closes #120

Wraps the ailed_events INSERT inside ingestEventQuarantined in its own try/catch so a bookkeeping failure (constraint violation, connection reset, disk full) cannot propagate out and strand the whole page.

  • The raw �vents row is already committed before folding, so it survives.
  • The derived-table transaction is rolled back before we attempt to record the failure.
  • If the bookkeeping insert itself fails, we log loudly and continue, so the cursor still advances and quarantineState is reset.

Adds a regression test that simulates a failing ailed_events insert during quarantine mode and verifies the indexer still completes the page and advances the cursor.

Verification

  • [x]
    pm run lint clean
  • [x]
    pm run typecheck clean
  • [ ]
    pm run test not run locally — no local Postgres (same constraint noted in the issue).

…n't strand events (ourdao#120)

- Wraps the failed_events INSERT in its own try/catch inside ingestEventQuarantined.
- Logs loudly when the bookkeeping insert itself fails.
- The raw events row is already committed, the derived tables were rolled back,
  and the cursor can still advance past the event.

Closes ourdao#120
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.

If recordQuarantinedEvent throws, the event is skipped forever on every later pass

2 participants