Skip to content

Commit 9e16cd4

Browse files
committed
Updated retry stage and change parameter reload_connections set false
1 parent 6a4b186 commit 9e16cd4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/fluent/plugin/in_opensearch.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class UnrecoverableRequestFailure < Fluent::UnrecoverableError; end
6464
config_param :repeat, :bool, :default => true
6565
config_param :http_backend, :enum, list: [:excon, :typhoeus], :default => :excon
6666
config_param :request_timeout, :time, :default => 5
67-
config_param :reload_connections, :bool, :default => true
67+
config_param :reload_connections, :bool, :default => false
6868
config_param :reload_on_failure, :bool, :default => false
6969
config_param :resurrect_after, :time, :default => 60
7070
config_param :reload_after, :integer, :default => DEFAULT_RELOAD_AFTER
@@ -215,7 +215,7 @@ def reachable_host?(host)
215215
host: ["#{host[:scheme]}://#{host[:host]}:#{host[:port]}"],
216216
user: host[:user],
217217
password: host[:password],
218-
reload_connections: @reload_connections,
218+
# reload_connections: @reload_connections,
219219
request_timeout: @request_timeout,
220220
resurrect_after: @resurrect_after,
221221
reload_on_failure: @reload_on_failure,
@@ -343,14 +343,18 @@ def update_retry_state(error=nil)
343343
@retry = retry_state(@retry_randomize)
344344
end
345345
@retry.step
346+
if error.message.include?('EOFError (EOFError)')
347+
log.error("Restart plugin #{error.message}")
348+
exit(1)
349+
end
346350
#Raise error if the retry limit has been reached
347351
raise "Hit limit for retries. retry_times: #{@retry.steps}, error: #{error.message}" if @retry.limit?
348352
#Retry if the limit hasn't been reached
349353
log.warn("failed to connect or search.", retry_times: @retry.steps, next_retry_time: @retry.next_time.round, error: error.message)
350354
sleep(@retry.next_time - Time.now)
351355
else
352356
unless @retry.nil?
353-
log.debug("retry succeeded.")
357+
log.info("retry succeeded.")
354358
@retry = nil
355359
end
356360
end

0 commit comments

Comments
 (0)