Skip to content

fix(core): classify "service unavailable" as transient for bulkWrite retry #2802

Description

@yinlianghui

Baseline and relation to #2678/#2680

Minimal reproduction

defaultIsTransientError(new Error('service unavailable'))
// actual: false

The QA harness executed this twice with the same result.

Expected / actual

  • Expected: a standard availability failure is classified transient and receives the configured retry attempts.
  • Actual: /server.*unavailable/i does not match service unavailable; the batch degrades immediately, and identical per-row failures are not retried.

Impact

A common 503-style message can drop seed/import rows despite #2678's reliability acceptance criterion.

Evidence and exclusions

  • Source: packages/core/src/utils/bulk-write.ts, TRANSIENT_PATTERNS.
  • Existing code/status-based cases (503, fetch failed, connection reset, timeout) remain outside this finding and passed QA.
  • This issue does not claim every arbitrary “unavailable” message is transient; the classifier should cover the established service-availability signature without retrying validation/constraint failures.

Required regression test

Add a classifier matrix case for service unavailable, plus a bulkWrite attempt-count test proving it retries while logical errors still do not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions