logstash-input-s3-sns-sqs 2.2.2.pre → 2.2.3.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f48075bfdde399dcbe35552359b2a15d91225b9d37c8e9e5ea58f338064e203
4
- data.tar.gz: a938b217f198d72fb629b2acdfa0333e6f567f486d3db640b90201bd738c7495
3
+ metadata.gz: '090be2e58313901bc0c357064df7955b63e3a8d2f843bb2bac3a4edd298aac5a'
4
+ data.tar.gz: ba639c3850880cfa1e46f6eead5de39268987fa83a7de3255106a133bd47c211
5
5
  SHA512:
6
- metadata.gz: 715bef961530b6a978413da785ac81e3dc3df9aa223ad6f00cbb96667e8ea1545a81856fd886d621934dd2455817cb2926606109340db5fe914fa3ce52498654
7
- data.tar.gz: e9b89e216f9c5ac0d4d5b26ea58f74d142b0be5c12cd6f479a9e27f0b25c9f5fb746056735c8dd80c9aa497d03cc825fb0e3a0dde9653d9e5d2030e1884d8148
6
+ metadata.gz: a80d28f30b0fcd0885fb4a5e66e06282d577e3ea3b2c7f785f1de48d686c610f2c18e88e023ca06b1a6a22ccd6c27a031e445f94df086cdbed71ec75af4bd33b
7
+ data.tar.gz: abf25aa9f2001909651fd083abd56d2eea04e0667e3dc496fbd7e93b0e5d7a4b38063fe944ef72f707aed6353af3a2a689978cc8c3aee46c1656c549f4870982
data/CHANGELOG.md CHANGED
@@ -1,7 +1,11 @@
1
+ ##2.2.3
2
+ Be aware of transient errors from other pipeline parts
1
3
  ##2.2.2
2
4
  Fix gzip validation not to return true if only file extension is gz
3
5
  Make logstash 8/9 compatible
4
6
  Inhouse mixin components
7
+ BUGFIX for JRuby 9.4+
8
+ FEATURE move_to_bucket (PR #82)
5
9
  ##2.2.0
6
10
  -AWS-SDK-3 update
7
11
  ##2.1.3
@@ -329,25 +329,72 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
329
329
  # --- END plugin interface ------------------------------------------#
330
330
 
331
331
  private
332
+ Aws.config.update({
333
+ http_open_timeout: 60,
334
+ http_read_timeout: 120,
335
+ retry_limit: 5, # Increase the retry limit
336
+ retry_backoff: lambda { |c| sleep(2 ** c.retries) } # Exponential backoff
337
+ })
338
+
332
339
  def run_worker_thread(queue, thread_id)
333
340
  Thread.new do
334
- LogStash::Util.set_thread_name("Worker #{@id}/#{thread_id}")
335
- @logger.info("[#{Thread.current[:name]}] started (#{Time.now})") #PROFILING
336
- temporary_directory = Dir.mktmpdir("#{@temporary_directory}/")
337
- @sqs_poller.run do |record|
338
- throw :skip_delete if stop?
339
- # record is a valid object with the keys ":bucket", ":key", ":size"
340
- record[:local_file] = File.join(temporary_directory, File.basename(record[:key]))
341
- if @s3_downloader.copy_s3object_to_disk(record)
342
- completed = catch(:skip_delete) do
343
- process(record, queue)
341
+ begin
342
+ LogStash::Util.set_thread_name("Worker #{@id}/#{thread_id}")
343
+ @logger.info("[#{Thread.current[:name]}] started (#{Time.now})") #PROFILING
344
+ temporary_directory = Dir.mktmpdir("#{@temporary_directory}/")
345
+ @sqs_poller.run do |record|
346
+ begin
347
+ throw :skip_delete if stop?
348
+ # record is a valid object with the keys ":bucket", ":key", ":size"
349
+ record[:local_file] = File.join(temporary_directory, File.basename(record[:key]))
350
+ if @s3_downloader.copy_s3object_to_disk(record)
351
+ completed = catch(:skip_delete) do
352
+ @logger.debug("[#{Thread.current[:name]}] processing record: #{record}")
353
+ process(record, queue)
354
+ end
355
+ @s3_downloader.cleanup_local_object(record)
356
+ # re-throw if necessary:
357
+ throw :skip_delete unless completed
358
+ @s3_downloader.move_s3object(record)
359
+ @s3_downloader.cleanup_s3object(record)
360
+ end
361
+ rescue Seahorse::Client::NetworkingError => e
362
+ @logger.error("[#{Thread.current[:name]}] Networking error inside poller loop: #{e.message}")
363
+ @retry_count ||= 0
364
+ if @retry_count < 5
365
+ @retry_count += 1
366
+ sleep(2 ** @retry_count) # Exponential backoff
367
+ logger.info("[#{Thread.current[:name]}] Retry #{retry_count} of 5 for networking error")
368
+ retry
369
+ else
370
+ @logger.error("[#{Thread.current[:name]}] Exceeded retry limit for networking error: #{e.message}")
371
+ @received_stop.make_true
372
+ raise
373
+ end
374
+ rescue StandardError => e
375
+ @logger.error("[#{Thread.current[:name]}] Error processing record inside poller loop: #{e.message}")
376
+ @logger.error(e.backtrace.join("\n"))
377
+ @received_stop.make_true
378
+ raise
344
379
  end
345
- @s3_downloader.cleanup_local_object(record)
346
- # re-throw if necessary:
347
- throw :skip_delete unless completed
348
- @s3_downloader.move_s3object(record)
349
- @s3_downloader.cleanup_s3object(record)
350
380
  end
381
+ rescue Seahorse::Client::NetworkingError => e
382
+ @logger.error("Networking error in thread management: #{e.message}")
383
+ @retry_count ||= 0
384
+ if @retry_count < 5
385
+ @retry_count += 1
386
+ sleep(2 ** @retry_count) # Exponential backoff
387
+ logger.info("[#{Thread.current[:name]}] Retry #{retry_count} of 5 for networking error")
388
+ retry
389
+ else
390
+ @logger.error("Exceeded retry limit for networking error: #{e.message}")
391
+ @received_stop.make_true
392
+ raise
393
+ end
394
+ rescue StandardError => e
395
+ @logger.error("Unexpected error in thread management: #{e.message}")
396
+ @received_stop.make_true
397
+ raise
351
398
  end
352
399
  end
353
400
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-s3-sns-sqs'
3
- s.version = '2.2.2.pre'
3
+ s.version = '2.2.3.pre'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = "Get logs from AWS s3 buckets as issued by an object-created event via sns -> sqs."
6
6
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-s3-sns-sqs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2.pre
4
+ version: 2.2.3.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Herweg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-15 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement