lib/logstash/outputs/s3.rb in logstash-output-s3-4.2.0 vs lib/logstash/outputs/s3.rb in logstash-output-s3-4.3.0
- old
+ new
@@ -186,10 +186,16 @@
# The common use case is to define permission on the root bucket and give Logstash full access to write its logs.
# In some circonstances you need finer grained permission on subfolder, this allow you to disable the check at startup.
config :validate_credentials_on_root_bucket, :validate => :boolean, :default => true
+ # The number of times to retry a failed S3 upload.
+ config :retry_count, :validate => :number, :default => Float::INFINITY
+
+ # The amount of time to wait in seconds before attempting to retry a failed upload.
+ config :retry_delay, :validate => :number, :default => 1
+
def register
# I've move the validation of the items into custom classes
# to prepare for the new config validation that will be part of the core so the core can
# be moved easily.
unless @prefix.empty?
@@ -217,11 +223,11 @@
executor = Concurrent::ThreadPoolExecutor.new({ :min_threads => 1,
:max_threads => @upload_workers_count,
:max_queue => @upload_queue_size,
:fallback_policy => :caller_runs })
- @uploader = Uploader.new(bucket_resource, @logger, executor)
+ @uploader = Uploader.new(bucket_resource, @logger, executor, retry_count: @retry_count, retry_delay: @retry_delay)
# Restoring from crash will use a new threadpool to slowly recover
# New events should have more priority.
restore_from_crash if @restore
@@ -322,13 +328,9 @@
@periodic_check.shutdown
end
def bucket_resource
Aws::S3::Bucket.new(@bucket, full_options)
- end
-
- def aws_service_endpoint(region)
- { :s3_endpoint => region == 'us-east-1' ? 's3.amazonaws.com' : "s3-#{region}.amazonaws.com"}
end
def rotate_if_needed(prefixes)
prefixes.each do |prefix|
# Each file access is thread safe,