logstash-input-lumberjack 2.0.1 → 2.0.2

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: b273f528393d8084ada814564a4c80c064c89cb5
4
- data.tar.gz: b9d12a73e7ce5197b418fa3cdcb0c607339d0f3e
3
+ metadata.gz: 6439998770b842a2295277eb852f74c538a33e8d
4
+ data.tar.gz: 7d7fb7d8bc8afdb4780c53b1322e41b5c667bf2f
5
5
  SHA512:
6
- metadata.gz: 0209b47c888b247cb1027f17be8518f3fe0ccea69f237b3a1c009133ddfde0a6d06ea6cf84292c016ee3e54b88fc8f5983773f7f7e7a33378b7f3e24870e73dc
7
- data.tar.gz: be5fc6c8d217343290162fa049ccaeb446dcb56edc432cb519eb39d2b2d7f22fae69c4af5d048fd962097c54d1dd1c8ef5e9094cffc2feb3f7b6ffb8fa12920a
6
+ metadata.gz: 4e58cf8471ba746773cdfe347781c587cb64e70ee468a7ba6f699f0aa872209409db18c8862f6a452e1cf7e2c912650d0bf358a989ab7c0c1abbfd7ab469c6f0
7
+ data.tar.gz: 291db828aa1a19663e38fad3b11db54ad842a685cad3a2f9fc5c5ff00adce5e72159f72c8364eae44224e8d9f2620c146874d090f487bc7002c18463cf65f099
data/CHANGELOG.md CHANGED
@@ -1,6 +1,8 @@
1
- ## 2.0.0
1
+ ## 2.0.2
2
2
  - Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
3
3
  instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
4
+
5
+ ## 2.0.0
4
6
  - Dependency on logstash-core update to 2.0
5
7
 
6
8
  # 1.0.5
@@ -68,12 +68,17 @@ class LogStash::Inputs::Lumberjack < LogStash::Inputs::Base
68
68
  def run(output_queue)
69
69
  start_buffer_broker(output_queue)
70
70
 
71
- while true do
71
+ while !stop? do
72
72
  # Wrappingu the accept call into a CircuitBreaker
73
73
  if @circuit_breaker.closed?
74
- connection = @lumberjack.accept # Blocking call that creates a new connection
75
-
74
+ connection = @lumberjack.accept # call that creates a new connection
75
+ next if connection.nil? # if the connection is nil the connection was close.
76
76
  invoke(connection, @codec.clone) do |_codec, line, fields|
77
+ if stop?
78
+ connection.close
79
+ break
80
+ end
81
+
77
82
  _codec.decode(line) do |event|
78
83
  begin
79
84
  decorate(event)
@@ -89,12 +94,13 @@ class LogStash::Inputs::Lumberjack < LogStash::Inputs::Base
89
94
  sleep(RECONNECT_BACKOFF_SLEEP)
90
95
  end
91
96
  end
92
- rescue LogStash::ShutdownSignal
93
- @logger.info("Lumberjack input: received ShutdownSignal")
94
- ensure
95
- shutdown(output_queue)
96
97
  end # def run
97
98
 
99
+ public
100
+ def stop
101
+ @lumberjack.close
102
+ end
103
+
98
104
  private
99
105
  def invoke(connection, codec, &block)
100
106
  @threadpool.post do
@@ -121,7 +127,7 @@ class LogStash::Inputs::Lumberjack < LogStash::Inputs::Base
121
127
 
122
128
  def start_buffer_broker(output_queue)
123
129
  @threadpool.post do
124
- while true
130
+ while !stop?
125
131
  output_queue << @buffered_queue.pop_no_timeout
126
132
  end
127
133
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-lumberjack'
4
- s.version = '2.0.1'
4
+ s.version = '2.0.2'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Receive events using the lumberjack protocol."
7
7
  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"
@@ -47,4 +47,8 @@ describe LogStash::Inputs::Lumberjack do
47
47
  end
48
48
  end
49
49
  end
50
+
51
+ context "when interrupting the plugin" do
52
+ it_behaves_like "an interruptible input plugin"
53
+ end
50
54
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-lumberjack
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-08 00:00:00.000000000 Z
11
+ date: 2015-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement