logstash-input-s3-sns-sqs 2.2.2 → 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: 768ce9035208439c099873bdf95e646f8e1b5e914dfbe5582a2fcc6dc1858804
4
- data.tar.gz: 037c43af0920d57ab17ac6a54ee5142b2224a737cad0bcc7fd88bea37f0a5b9c
3
+ metadata.gz: '090be2e58313901bc0c357064df7955b63e3a8d2f843bb2bac3a4edd298aac5a'
4
+ data.tar.gz: ba639c3850880cfa1e46f6eead5de39268987fa83a7de3255106a133bd47c211
5
5
  SHA512:
6
- metadata.gz: 19ff1c3dd59fe6967f2b735ca57c2a10ecdbe08a2340071ff4bf7aa8a169c8b89f0ca49267b0f66783af2dfd77af5e1bfaae2fddacc601563462d19016dceb2e
7
- data.tar.gz: 4820c8b318bbbeff583cfb3e2c86d6fe13592e8da588d512af18fa174c9961fa160f6842528a0e534e1e88b955e47a47ec39b6c7870ead20d34fb0ec20472b25
6
+ metadata.gz: a80d28f30b0fcd0885fb4a5e66e06282d577e3ea3b2c7f785f1de48d686c610f2c18e88e023ca06b1a6a22ccd6c27a031e445f94df086cdbed71ec75af4bd33b
7
+ data.tar.gz: abf25aa9f2001909651fd083abd56d2eea04e0667e3dc496fbd7e93b0e5d7a4b38063fe944ef72f707aed6353af3a2a689978cc8c3aee46c1656c549f4870982
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
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
@@ -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'
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
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
@@ -277,9 +277,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
277
277
  version: '0'
278
278
  required_rubygems_version: !ruby/object:Gem::Requirement
279
279
  requirements:
280
- - - ">="
280
+ - - ">"
281
281
  - !ruby/object:Gem::Version
282
- version: '0'
282
+ version: 1.3.1
283
283
  requirements: []
284
284
  rubygems_version: 3.2.29
285
285
  signing_key: