Retry bulk import on transient server errors (502/503/504/429)#40
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BadGatewayError(502),ServiceUnavailableError(503),GatewayTimeoutError(504), andTooManyRequestsError(429) during bulk import and retries with exponential backoff before raisingTooManyRequestsError(429) to the transport error mapping (was missing)bulk_retry_on_failure_max_retries(default: 3) andbulk_retry_on_failure_wait(default: 2.0s) — settable globally or per-index, consistent with existingbulk_wait_intervalpatternTest plan
bundle exec rspec spec/esse/import/bulk_spec.rb— 14 examples, 0 failuresSTUB_STACK=elasticsearch-7.17.0 BUNDLE_GEMFILE=gemfiles/Gemfile.elasticsearch-7.x bundle exec rspec— 2245 examples, 0 failures