Skip to content

Fix: one failing exporter should not abort the others#754

Merged
brafdlog merged 2 commits intomasterfrom
fix/exporter-isolate-failures
Apr 17, 2026
Merged

Fix: one failing exporter should not abort the others#754
brafdlog merged 2 commits intomasterfrom
fix/exporter-isolate-failures

Conversation

@brafdlog
Copy link
Copy Markdown
Owner

Problem

When one exporter's exportTransactions throws, the entire export pipeline aborts:

  1. Per-exporter catch block re-throws the error
  2. Promise.all(exportPromises) rejects fail-fast
  3. Other still-running exporters are orphaned
  4. log.summary() never runs
  5. EXPORT_PROCESS_END event never fires
  6. yarn scrape exits non-zero

A single exporter hitting a runtime error prevents all other exporters from completing, even though their work is independent.

Fix

  1. Remove the throw e in the per-exporter catch block. The outcome is already recorded via successCount/failedCount counters and the EXPORTER_ERROR event — re-throwing adds nothing but the fail-fast behavior.
  2. Switch Promise.allPromise.allSettled so an error outside the try/catch still cannot abort other exporters or skip the summary.

Added unit tests covering both invariants:

  • one exporter throwing does not prevent the others from running
  • the function resolves (does not reject) with a partial result

Verification

  • yarn test:main → 45 passed
  • yarn typecheck:main → clean
  • yarn lint → clean

brafdlog and others added 2 commits April 17, 2026 11:03
When any exporter's exportTransactions throws, the catch block re-throws
and Promise.all(exportPromises) rejects fail-fast. This orphans any
still-running exporters, skips the summary log, and prevents the
EXPORT_PROCESS_END event from firing.

Fix:
- Remove the re-throw in the per-exporter catch block. The outcome is
  already recorded via successCount/failedCount counters and the
  EXPORTER_ERROR event.
- Switch Promise.all to Promise.allSettled so an error outside the
  try/catch still cannot abort other exporters or skip the summary.

Add unit tests: one exporter throwing does not prevent the others from
running, and the function resolves (does not reject) with a partial
result.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@brafdlog brafdlog merged commit 84a69cd into master Apr 17, 2026
10 checks passed
@brafdlog brafdlog deleted the fix/exporter-isolate-failures branch April 17, 2026 08:34
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.18.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant