diff --git a/README.md b/README.md index 3b150d6..659ddc2 100644 --- a/README.md +++ b/README.md @@ -605,10 +605,10 @@ request_timeout 15s # defaults to 5s ### reload_connections -You can tune how the opensearch-transport host reloading feature works. By default it will reload the host list from the server every 10,000th request to spread the load. This can be an issue if your OpenSearch cluster is behind a Reverse Proxy, as Fluentd process may not have direct network access to the OpenSearch nodes. +You can tune how the opensearch-transport host reloading feature works. By default it off but if you set true it will reload the host list from the server every 10,000th request to spread the load. This can be an issue if your OpenSearch cluster is behind a Reverse Proxy, as Fluentd process may not have direct network access to the OpenSearch nodes. ``` -reload_connections false # defaults to true +reload_connections false # defaults to false ``` ### reload_on_failure diff --git a/lib/fluent/plugin/in_opensearch.rb b/lib/fluent/plugin/in_opensearch.rb index 3b98712..23c930a 100644 --- a/lib/fluent/plugin/in_opensearch.rb +++ b/lib/fluent/plugin/in_opensearch.rb @@ -64,7 +64,7 @@ class UnrecoverableRequestFailure < Fluent::UnrecoverableError; end config_param :repeat, :bool, :default => true config_param :http_backend, :enum, list: [:excon, :typhoeus], :default => :excon config_param :request_timeout, :time, :default => 5 - config_param :reload_connections, :bool, :default => true + config_param :reload_connections, :bool, :default => false config_param :reload_on_failure, :bool, :default => false config_param :resurrect_after, :time, :default => 60 config_param :reload_after, :integer, :default => DEFAULT_RELOAD_AFTER @@ -215,7 +215,7 @@ def reachable_host?(host) host: ["#{host[:scheme]}://#{host[:host]}:#{host[:port]}"], user: host[:user], password: host[:password], - reload_connections: @reload_connections, + # reload_connections: @reload_connections, request_timeout: @request_timeout, resurrect_after: @resurrect_after, reload_on_failure: @reload_on_failure, @@ -343,6 +343,10 @@ def update_retry_state(error=nil) @retry = retry_state(@retry_randomize) end @retry.step + if error.message.include?('EOFError (EOFError)') + log.error("Restart plugin because hit error #{error.message}") + exit(1) + end #Raise error if the retry limit has been reached raise "Hit limit for retries. retry_times: #{@retry.steps}, error: #{error.message}" if @retry.limit? #Retry if the limit hasn't been reached @@ -350,7 +354,7 @@ def update_retry_state(error=nil) sleep(@retry.next_time - Time.now) else unless @retry.nil? - log.debug("retry succeeded.") + log.info("retry succeeded.") @retry = nil end end