Skip to content

Commit

Permalink
Fix: stop poller when input is being shutdown (#65)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Popescu <[email protected]>
  • Loading branch information
yaauie and danielpops authored Mar 17, 2022
1 parent 26dc976 commit 5d7aaec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.3.2
- Fix an issue that prevented timely shutdown when subscribed to an inactive queue

## 3.3.1
- Refactoring: used logstash-mixin-aws to leverage shared code to manage `additional_settings` [#64](https://github.com/logstash-plugins/logstash-input-sqs/pull/64)

Expand Down
5 changes: 4 additions & 1 deletion lib/logstash/inputs/sqs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ def queue_url(aws_sqs_client)

def setup_queue
aws_sqs_client = Aws::SQS::Client.new(aws_options_hash || {})
@poller = Aws::SQS::QueuePoller.new(queue_url(aws_sqs_client), :client => aws_sqs_client)
poller = Aws::SQS::QueuePoller.new(queue_url(aws_sqs_client), :client => aws_sqs_client)
poller.before_request { |stats| throw :stop_polling if stop? }

@poller = poller
rescue Aws::SQS::Errors::ServiceError, Seahorse::Client::NetworkingError => e
@logger.error("Cannot establish connection to Amazon SQS", exception_details(e))
raise LogStash::ConfigurationError, "Verify the SQS queue name and your credentials"
Expand Down
2 changes: 1 addition & 1 deletion logstash-input-sqs.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'logstash-input-sqs'
s.version = '3.3.1'
s.version = '3.3.2'
s.licenses = ['Apache-2.0']
s.summary = "Pulls events from an Amazon Web Services Simple Queue Service queue"
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
Expand Down

0 comments on commit 5d7aaec

Please sign in to comment.