logstash-input-syslog 3.2.3 → 3.2.4

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: eaa7bffcee872ad4acc31204befd27fe1dfaf8b7ed7e2ea1f9c5f83cd1e90d55
4
- data.tar.gz: '08e2261511e7ebaac9406c438680e37894b9ed97bc8219f957dc6c5cc31e66e5'
3
+ metadata.gz: a308c5702d6887cf5bf7842fdd4b3cd37d8b3591bb9abf84914473b5711ffffd
4
+ data.tar.gz: bda506472180eed7313a59b0927b589658ac3344484cfef7b245bbb463a92611
5
5
  SHA512:
6
- metadata.gz: bce1f222438c07c3f56691febb451a578e59861e36ba980bc81656ba4390f36bb820c6f945bc803317b9f35ca557377f9eb2a8e5102e63597030fb522d6ababb
7
- data.tar.gz: 7fb0770942f47b8819887bae185bba673e8390ae30bbdc8622913c0d7efaada310226e580de0cd109ec24ad1a51d5a2a064c395fa8e1d3de7393ce2f0d456ad9
6
+ metadata.gz: 86baef4a8e94743bb2523eede569072947d26cddede101162c72b1ee17ed74be9aef62232f4a4d2f0a7b2b4adbe3134051abf6ba91c5b17d2ea7125d255da0be
7
+ data.tar.gz: 5073d8e96af959e9d71cda4d77e11a2224249733c95386cf818277ed35e6a19b56c43bf33f5efee7039bcab64db771204d5da5b83c9d887d7d589273f0a7b642
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.2.4
2
+ - Fix issue where stopping a pipeline (e.g., while reloading configuration) with active inbound syslog connections could cause Logstash to crash
3
+
1
4
  ## 3.2.3
2
5
  - Update gemspec summary
3
6
 
@@ -199,9 +199,17 @@ class LogStash::Inputs::Syslog < LogStash::Inputs::Base
199
199
  end
200
200
  rescue Errno::ECONNRESET
201
201
  # swallow connection reset exceptions to avoid bubling up the tcp_listener & server
202
+ logger.info("connection reset", :client => "#{ip}:#{port}")
203
+ rescue Errno::EBADF
204
+ # swallow connection closed exceptions to avoid bubling up the tcp_listener & server
205
+ logger.info("connection closed", :client => "#{ip}:#{port}")
206
+ rescue IOError => ioerror
207
+ # swallow connection closed exceptions to avoid bubling up the tcp_listener & server
208
+ raise unless socket.closed? && ioerror.message.include?("closed")
209
+ logger.info("connection error: #{ioerror.message}")
202
210
  ensure
203
211
  @tcp_sockets.delete(socket)
204
- socket.close rescue nil
212
+ socket.close rescue log_and_squash
205
213
  end
206
214
 
207
215
  private
@@ -228,19 +236,36 @@ class LogStash::Inputs::Syslog < LogStash::Inputs::Base
228
236
  private
229
237
  def close_udp
230
238
  if @udp
231
- @udp.close_read rescue nil
232
- @udp.close_write rescue nil
239
+ @udp.close_read rescue log_and_squash
240
+ @udp.close_write rescue log_and_squash
233
241
  end
234
242
  @udp = nil
235
243
  end
236
244
 
237
245
  private
246
+
247
+ # Helper for inline rescues, which logs the squashed exception at "TRACE" level
248
+ # and returns nil.
249
+ #
250
+ # Instead of:
251
+ # ~~~ ruby
252
+ #. foo rescue nil
253
+ # ~~~
254
+ # Do:
255
+ # ~~~ ruby
256
+ #. foo rescue log_and_squash
257
+ # ~~~
258
+ def log_and_squash
259
+ $! && logger.trace("SQUASHED EXCEPTION: `#{$!.message}` at (`#{caller.first}`)")
260
+ nil
261
+ end
262
+
238
263
  def close_tcp
239
264
  # If we somehow have this left open, close it.
240
265
  @tcp_sockets.each do |socket|
241
- socket.close rescue nil
266
+ socket.close rescue log_and_squash
242
267
  end
243
- @tcp.close if @tcp rescue nil
268
+ @tcp.close if @tcp rescue log_and_squash
244
269
  @tcp = nil
245
270
  end
246
271
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-syslog'
4
- s.version = '3.2.3'
4
+ s.version = '3.2.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Reads syslog messages as events"
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/logstash-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-syslog
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.3
4
+ version: 3.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-07 00:00:00.000000000 Z
11
+ date: 2017-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  requirements: []
176
176
  rubyforge_project:
177
- rubygems_version: 2.6.11
177
+ rubygems_version: 2.6.13
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Reads syslog messages as events