Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
esse (0.5.2)
esse (0.5.3)
multi_json
thor (>= 0.19)

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.elasticsearch-1.x.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
esse (0.5.2)
esse (0.5.3)
multi_json
thor (>= 0.19)

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.elasticsearch-2.x.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
esse (0.5.2)
esse (0.5.3)
multi_json
thor (>= 0.19)

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.elasticsearch-5.x.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
esse (0.5.2)
esse (0.5.3)
multi_json
thor (>= 0.19)

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.elasticsearch-6.x.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
esse (0.5.2)
esse (0.5.3)
multi_json
thor (>= 0.19)

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.elasticsearch-7.x.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
esse (0.5.2)
esse (0.5.3)
multi_json
thor (>= 0.19)

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.elasticsearch-8.x.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
esse (0.5.2)
esse (0.5.3)
multi_json
thor (>= 0.19)

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.opensearch-1.x.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
esse (0.5.2)
esse (0.5.3)
multi_json
thor (>= 0.19)

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.opensearch-2.x.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
esse (0.5.2)
esse (0.5.3)
multi_json
thor (>= 0.19)

Expand Down
3 changes: 2 additions & 1 deletion lib/esse/import/bulk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def each_request(max_retries: 4, last_retry_in_small_chunks: true, last_retry_pe
If a single document still exceeds the bulk size, the error will be raised.
MSG
retry
rescue Esse::Transport::BadGatewayError,
rescue Faraday::ConnectionFailed,
Esse::Transport::BadGatewayError,
Esse::Transport::ServiceUnavailableError,
Esse::Transport::GatewayTimeoutError,
Esse::Transport::TooManyRequestsError => e
Expand Down
2 changes: 1 addition & 1 deletion lib/esse/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Esse
VERSION = '0.5.2'
VERSION = '0.5.3'
end
13 changes: 13 additions & 0 deletions spec/esse/import/bulk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ def build_from_documents(type: nil, index: nil, delete: nil, create: nil, update
end
end

it 'retries on Faraday::ConnectionFailed' do
allow(bulk).to receive(:sleep)
allow(Esse.logger).to receive(:warn)
retries = 0
expect {
bulk.each_request(retry_on_failure_max_retries: 2, retry_on_failure_wait: 0) { |_request|
retries += 1
raise Faraday::ConnectionFailed, RuntimeError.new('getaddrinfo: Try again')
}
}.to raise_error(Faraday::ConnectionFailed)
expect(retries).to eq(2)
end

it 'succeeds when transient error resolves before threshold' do
allow(bulk).to receive(:sleep)
allow(Esse.logger).to receive(:warn)
Expand Down
Loading