Skip to content

Retry bulk import on transient server errors (502/503/504/429)#40

Merged
marcosgz merged 1 commit into
mainfrom
retry-transient-errors
May 16, 2026
Merged

Retry bulk import on transient server errors (502/503/504/429)#40
marcosgz merged 1 commit into
mainfrom
retry-transient-errors

Conversation

@marcosgz

@marcosgz marcosgz commented May 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Catches BadGatewayError (502), ServiceUnavailableError (503), GatewayTimeoutError (504), and TooManyRequestsError (429) during bulk import and retries with exponential backoff before raising
  • Backoff schedule (default): 2s → 4s → raises on 3rd failure
  • Adds TooManyRequestsError (429) to the transport error mapping (was missing)
  • New config options bulk_retry_on_failure_max_retries (default: 3) and bulk_retry_on_failure_wait (default: 2.0s) — settable globally or per-index, consistent with existing bulk_wait_interval pattern
  • Bumps version to 0.5.1, updates all Gemfile locks

Test plan

  • bundle exec rspec spec/esse/import/bulk_spec.rb — 14 examples, 0 failures
  • STUB_STACK=elasticsearch-7.17.0 BUNDLE_GEMFILE=gemfiles/Gemfile.elasticsearch-7.x bundle exec rspec — 2245 examples, 0 failures

…ackoff

Catches 502/503/504/429 responses and retries with exponential backoff
(2s base, doubling each attempt) up to a configurable threshold before
raising. Adds TooManyRequestsError (429) to the transport error mapping.

New config: bulk_retry_on_failure_max_retries (default 3) and
bulk_retry_on_failure_wait (default 2.0s), settable globally or per-index.

Bumps version to 0.5.1.
@marcosgz
marcosgz merged commit 470eed1 into main May 16, 2026
28 checks passed
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