logstash-filter-grok 3.2.2 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2156be2aaef0d13ad330e90b4e944f07fd5caa4
4
- data.tar.gz: 8942af6f6ca5680c40f4851e6ba94c669e79bfc1
3
+ metadata.gz: e45feb32b6599f171a7d75ef08a165301a02a798
4
+ data.tar.gz: d6895d5112db9412404ddb9da3806210b85a15b4
5
5
  SHA512:
6
- metadata.gz: ab1e10603d6cbf3bd6ee646a2e2c201f327c0e435c06cfb4e729905ed062fbbd1ce8afa1cadc0a4ac69620af36657a7a2cc252cc28f26dec040d0e802bed20fd
7
- data.tar.gz: 9aa1ba7a12e0f8bdff56979d508e367a34d5d1f140c10e73d0dd0571e72c5727e3cd3bf7d9ca7a097dbaa82584644a53bc9a4a5cd12a7147047045220211f9cd
6
+ metadata.gz: c5c7c112f2e3e3025ee58eb0ec4dd576db6073e07c3dfd40a53febeca25236aa585d4f8be56d4d6a7c55c4fb961cc665d4116655366ab899d84541da4dbd0301
7
+ data.tar.gz: 0d26a71dd53d0fd60bfbeaa7c16455c94206d0149c985677b1e413379d3eef5da3371321d1780102f925be5a47e05ca71d0ae7217f6a4e58bb2e8b922eee1b7e
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## 3.2.2
1
+ ## 3.2.3
2
+ - No longer use 'trace' log level as it breaks rspec
3
+ - Fix race conditions in timeout enforcer
4
+
5
+ ## 3.2.3
2
6
  - Move one log message from info to debug to avoid noise
3
7
 
4
8
  ## 3.2.1
@@ -14,24 +14,21 @@ class LogStash::Filters::Grok::TimeoutEnforcer
14
14
 
15
15
  def grok_till_timeout(event, grok, field, value)
16
16
  begin
17
- thread = Thread.current
17
+ thread = java.lang.Thread.currentThread()
18
18
  start_thread_groking(thread)
19
19
  yield
20
- rescue ::LogStash::Filters::Grok::TimeoutException => e
21
- # These fields aren't present at the time the exception was raised
22
- # so we add them here.
23
- # We could store this metadata in the @threads_to_start_time hash
24
- # but that'd come at a perf cost and this works just as well.
25
- e.grok = grok
26
- e.field = field
27
- e.value = value
28
- raise e
20
+ rescue InterruptedRegexpError => e
21
+ raise ::LogStash::Filters::Grok::TimeoutException.new(grok, field, value)
29
22
  ensure
30
23
  stop_thread_groking(thread)
24
+ # Clear any interrupts from any previous invocations that were not caught by Joni
25
+ thread.interrupted
31
26
  end
32
27
  end
33
28
 
34
29
  def start_thread_groking(thread)
30
+ # Clear any interrupts from any previous invocations that were not caught by Joni
31
+ thread.interrupted
35
32
  @timer_mutex.synchronize do
36
33
  @threads_to_start_time[thread] = java.lang.System.nanoTime()
37
34
  end
@@ -50,7 +47,10 @@ class LogStash::Filters::Grok::TimeoutEnforcer
50
47
  elapsed = java.lang.System.nanoTime - start_time
51
48
  if elapsed > @timeout_nanos
52
49
  elapsed_millis = elapsed / 1000
53
- thread.raise(::LogStash::Filters::Grok::TimeoutException.new(elapsed_millis))
50
+ thread.interrupt()
51
+ # Ensure that we never attempt to cancel this thread twice in the event
52
+ # of weird races
53
+ stop_thread_groking(thread)
54
54
  end
55
55
  end
56
56
  end
@@ -1,8 +1,7 @@
1
1
  class LogStash::Filters::Grok::TimeoutException < Exception
2
- attr_accessor :elapsed_millis, :grok, :field, :value
2
+ attr_reader :grok, :field, :value
3
3
 
4
- def initialize(elapsed_millis, grok=nil, field=nil, value=nil)
5
- @elapsed_millis = elapsed_millis
4
+ def initialize(grok=nil, field=nil, value=nil)
6
5
  @field = field
7
6
  @value = value
8
7
  @grok = grok
@@ -20,4 +19,3 @@ class LogStash::Filters::Grok::TimeoutException < Exception
20
19
  end
21
20
  end
22
21
  end
23
-
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-grok'
4
- s.version = '3.2.2'
4
+ s.version = '3.2.3'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Parse arbitrary text and structure it."
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"
@@ -27,4 +27,3 @@ Gem::Specification.new do |s|
27
27
 
28
28
  s.add_development_dependency 'logstash-devutils'
29
29
  end
30
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-grok
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-15 00:00:00.000000000 Z
11
+ date: 2016-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement