logstash-input-s3-sns-sqs 1.5.2 → 1.5.3

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
  SHA1:
3
- metadata.gz: 551338b8aa2fab2c80ffe77647e9b5b23f325ceb
4
- data.tar.gz: d47bfd42d5d4be0755ebac6cc584791a817412a1
3
+ metadata.gz: c94472c2e0f553176174262701934a498e29b6c4
4
+ data.tar.gz: 848d9e0f416556376e0ef74d7538eae426a5121a
5
5
  SHA512:
6
- metadata.gz: ba84a290bfd425ef85b4096178013db7c12d6e9796fccef617655f7e8d030d7f32a151d32dab4cb1fc898aa2ff3ec03a68c5e13d2d5d6d6b08323cd30192fbc9
7
- data.tar.gz: b30d9286f67efd2efc329796b60ae4cf7899c3edbfa6848d9c7e19997d54c99d2c89c1cef6e555bcbc78590f64af7275a93598d28c13fefae12687fb3776c142
6
+ metadata.gz: 4e2ce0d7fa0fef03d374c4a7a9d6eefcda03fe635556fd24461aed30f5083fc8b15809a063d4cdbb8c5cffa8fee6c51c698c57cfeb0d27fa3e48e86d630f9830
7
+ data.tar.gz: f50e78c06714bbc92d06f32d8e8b88bc1d18ec0980f900dea4fb13b948ffb8d1edd64dae64e0cabd093b046cc044c0fe12b5bb44cef7c764603c8acc5e413c25
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ ##1.5.3
2
+ - Try to fix requeue Problem
1
3
  ## 1.5.2
2
4
  - BugFix Set Metadata bucket,key,folder
3
5
  - Feature: Possibility to fall back to old threadding model by unset consumer_threads
@@ -7,6 +7,7 @@ require "logstash/plugin_mixins/aws_config"
7
7
  require "logstash/errors"
8
8
  require 'logstash/inputs/s3sqs/patch'
9
9
  require "aws-sdk"
10
+ require "stud/interval"
10
11
  require 'cgi'
11
12
  require 'logstash/inputs/mime/MagicgzipValidator'
12
13
 
@@ -121,6 +122,7 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
121
122
  config :s3_role_arn, :validate => :string
122
123
  # Session name to use when assuming an IAM role
123
124
  config :s3_role_session_name, :validate => :string, :default => "logstash"
125
+ config :visibility_timeout, :validate => :number, :default => 600
124
126
 
125
127
 
126
128
  attr_reader :poller
@@ -170,6 +172,8 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
170
172
  :max_number_of_messages => 1,
171
173
  # we will use the queue's setting, a good value is 10 seconds
172
174
  # (to ensure fast logstash shutdown on the one hand and few api calls on the other hand)
175
+ :skip_delete => false,
176
+ :visibility_timeout => @visibility_timeout,
173
177
  :wait_time_seconds => nil,
174
178
  }
175
179
  end
@@ -216,11 +220,18 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
216
220
  filename = File.join(temporary_directory, File.basename(key))
217
221
  if download_remote_file(object, filename)
218
222
  if process_local_log( filename, key, folder, instance_codec, queue, bucket)
219
- delete_file_from_bucket(object)
220
- FileUtils.remove_entry_secure(filename, true)
223
+ begin
224
+ FileUtils.remove_entry_secure(filename, true)
225
+ delete_file_from_bucket(object)
226
+ rescue Exception => e
227
+ @logger.debug("We had problems to delete your file", :file => filename, :error => e)
221
228
  end
222
- else
223
- FileUtils.remove_entry_secure(filename, true)
229
+ else
230
+ begin
231
+ FileUtils.remove_entry_secure(filename, true)
232
+ rescue Exception => e
233
+ @logger.debug("We had problems clean up your tmp dir", :file => filename, :error => e)
234
+ end
224
235
  end
225
236
  end
226
237
 
@@ -449,7 +460,16 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
449
460
  # poll a message and process it
450
461
  run_with_backoff do
451
462
  poller.poll(polling_options) do |message|
452
- handle_message(message, queue, @codec.clone)
463
+ begin
464
+ Stud.interval(@visibility_timeout - 10 ) do
465
+ @logger.info("Increasing the visibility_timeout ... ")
466
+ poller.change_message_visibility_timeout(msg, 60)
467
+ end
468
+ handle_message(message, queue, @codec.clone)
469
+ poller.delete_message(message)
470
+ rescue Exception => e
471
+ @logger.info("Error in poller block ... ", :error => e)
472
+ end
453
473
  end
454
474
  end
455
475
  end
@@ -487,7 +507,16 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
487
507
  # poll a message and process it
488
508
  run_with_backoff do
489
509
  poller.poll(polling_options) do |message|
490
- handle_message(message, queue, @codec.clone)
510
+ begin
511
+ Stud.interval(@visibility_timeout - 10 ) do
512
+ @logger.info("Increasing the visibility_timeout ... ")
513
+ poller.change_message_visibility_timeout(msg, 60)
514
+ end
515
+ handle_message(message, queue, @codec.clone)
516
+ poller.delete_message(message)
517
+ rescue Exception => e
518
+ @logger.info("Error in poller block ... ", :error => e)
519
+ end
491
520
  end
492
521
  end
493
522
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-s3-sns-sqs'
3
- s.version = '1.5.2'
3
+ s.version = '1.5.3'
4
4
  s.licenses = ['Apache License (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: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Herweg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-17 00:00:00.000000000 Z
11
+ date: 2018-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement