logstash-core 2.0.0.rc1-java → 2.0.1-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of logstash-core might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6738c5b93f083b5b3e4ab2089e8abe1b5a39d2a
4
- data.tar.gz: c25d3996b2157eb78939cd68baa65f5793f2248a
3
+ metadata.gz: 75665fe7267b003aff27beb502af98bf15da04ed
4
+ data.tar.gz: 949bcf9fa8437800a8ae612c7adfa1b9d76e261f
5
5
  SHA512:
6
- metadata.gz: d92f22f1ec3d512218edd532e328ddbc5df2c8889a056ecbea4bac493d394247428ac93e3353f744825620669235699e1d6e33b45f1a6fcec61f4ce453f03ba3
7
- data.tar.gz: 5cceb907fa2837e4567366df43b315011eafaad2f81ce795b7a4712d400b879e2ab68b4a26e01dc21a3e360952306c8e07d911898957ffe8b0a5e029ec4293b0
6
+ metadata.gz: 2859fffb9a6e5da8dee8ae148d75d0f658969cdd6bc95b9e2c862f93e5236ed7c0dfd4bff70646e4771f739bad7ab290d4a1fceb02b49c52f0be0c3369929b70
7
+ data.tar.gz: 7501db7d701e0385f1ad1f417132fcca54017f7a94194ea2b7c1d73a8244b99dd96b2dae58e76d0cdd515159efda835d10c8d14a514ba8d33ce092633ed98513
@@ -3,4 +3,3 @@ require "logstash/patches/bugfix_jruby_2558"
3
3
  require "logstash/patches/cabin"
4
4
  require "logstash/patches/profile_require_calls"
5
5
  require "logstash/patches/stronger_openssl_defaults"
6
- require "logstash/patches/silence_concurrent_ruby_warning"
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  # The version of logstash.
3
- LOGSTASH_VERSION = "2.0.0-rc1"
3
+ LOGSTASH_VERSION = "2.0.1"
4
4
 
5
5
  # Note to authors: this should not include dashes because 'gem' barfs if
6
6
  # you include a dash in the version string.
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
23
23
  gem.add_runtime_dependency "clamp", "~> 0.6.5" #(MIT license) for command line args/flags
24
24
  gem.add_runtime_dependency "filesize", "0.0.4" #(MIT license) for :bytes config validator
25
25
  gem.add_runtime_dependency "gems", "~> 0.8.3" #(MIT license)
26
- gem.add_runtime_dependency "concurrent-ruby", "~> 0.9.1"
26
+ gem.add_runtime_dependency "concurrent-ruby", "0.9.2"
27
27
  gem.add_runtime_dependency "jruby-openssl", ">= 0.9.11" # Required to support TLSv1.2
28
28
 
29
29
  # TODO(sissel): Treetop 1.5.x doesn't seem to work well, but I haven't
@@ -39,7 +39,7 @@ Gem::Specification.new do |gem|
39
39
 
40
40
  if RUBY_PLATFORM == 'java'
41
41
  gem.platform = RUBY_PLATFORM
42
- gem.add_runtime_dependency "jrjackson", "~> 0.3.6" #(Apache 2.0 license)
42
+ gem.add_runtime_dependency "jrjackson", "~> 0.3.7" #(Apache 2.0 license)
43
43
  else
44
44
  gem.add_runtime_dependency "oj" #(MIT-style license)
45
45
  end
@@ -12,6 +12,7 @@ describe "Project licenses" do
12
12
  Regexp.union([ /mit/,
13
13
  /apache*/,
14
14
  /bsd/,
15
+ /artistic 2.*/,
15
16
  /ruby/,
16
17
  /lgpl/])
17
18
  }
@@ -0,0 +1,139 @@
1
+ require "logstash/util/retryable"
2
+
3
+ describe LogStash::Retryable do
4
+ class C
5
+ include LogStash::Retryable
6
+ end
7
+
8
+ class E < StandardError; end;
9
+ class F < StandardError; end;
10
+
11
+ subject {C.new}
12
+
13
+ context "with default fixed 1 second retry sleep" do
14
+
15
+ it "should execute once" do
16
+ expect(subject).to receive(:sleep).never
17
+ expect(subject.retryable(:rescue => nil){|i| expect(i).to eq(0); "foo"}).to eq("foo")
18
+ end
19
+
20
+ it "should not retry on non rescued exceptions" do
21
+ i = 0
22
+ expect(subject).to receive(:sleep).never
23
+ expect{subject.retryable(:rescue => E){i += 1; raise F}}.to raise_error(F)
24
+ expect(i).to eq(1)
25
+ end
26
+
27
+ it "should execute once and retry once by default" do
28
+ i = 0
29
+ expect(subject).to receive(:sleep).once.with(1)
30
+ expect{subject.retryable{i += 1; raise E}}.to raise_error(E)
31
+ expect(i).to eq(2)
32
+ end
33
+
34
+ it "should retry on rescued exceptions" do
35
+ i = 0
36
+ expect(subject).to receive(:sleep).once.with(1)
37
+ expect{subject.retryable(:rescue => E){i += 1; raise E}}.to raise_error(E)
38
+ expect(i).to eq(2)
39
+ end
40
+
41
+ it "should retry indefinitely" do
42
+ i = 0
43
+ expect(subject).to receive(:sleep).exactly(50).times.with(1)
44
+ expect{subject.retryable(:tries => 0, :rescue => E){i += 1; raise i <= 50 ? E : F}}.to raise_error(F)
45
+ end
46
+
47
+ it "should execute once and retry once by default and execute on_retry callback" do
48
+ i = 0
49
+ callback_values = []
50
+
51
+ callback = lambda do |retry_count, e|
52
+ callback_values << [retry_count, e]
53
+ end
54
+
55
+ expect(subject).to receive(:sleep).once.with(1)
56
+
57
+ expect do
58
+ subject.retryable(:on_retry => callback){i += 1; raise E}
59
+ end.to raise_error
60
+
61
+ expect(i).to eq(2)
62
+
63
+ expect(callback_values.size).to eq(1)
64
+ expect(callback_values[0][0]).to eq(1)
65
+ expect(callback_values[0][1]).to be_a(E)
66
+ end
67
+
68
+ it "should execute once and retry n times" do
69
+ i = 0
70
+ n = 3
71
+ expect(subject).to receive(:sleep).exactly(n).times.with(1)
72
+ expect{subject.retryable(:tries => n){i += 1; raise E}}.to raise_error(E)
73
+ expect(i).to eq(n + 1)
74
+ end
75
+
76
+ it "should execute once and retry n times and execute on_retry callback" do
77
+ i = 0
78
+ n = 3
79
+ callback_values = []
80
+
81
+ callback = lambda do |retry_count, e|
82
+ callback_values << [retry_count, e]
83
+ end
84
+
85
+ expect(subject).to receive(:sleep).exactly(n).times.with(1)
86
+
87
+ expect do
88
+ subject.retryable(:tries => n, :on_retry => callback){i += 1; raise E}
89
+ end.to raise_error
90
+
91
+ expect(i).to eq(n + 1)
92
+
93
+ expect(callback_values.size).to eq(n)
94
+ n.times.each do |j|
95
+ expect(callback_values[j].first).to eq(j + 1)
96
+ expect(callback_values[j].last).to be_a(E)
97
+ end
98
+ end
99
+ end
100
+
101
+ context "with exponential backoff" do
102
+
103
+ it "should execute once and retry once with base sleep by default" do
104
+ expect(subject).to receive(:sleep).once.with(2)
105
+ expect do
106
+ subject.retryable(:base_sleep => 2, :max_sleep => 10){raise E}
107
+ end.to raise_error(E)
108
+ end
109
+
110
+ it "should execute once and retry n times with exponential backoff sleep" do
111
+ n = 3
112
+ s = 0.5
113
+
114
+ n.times.each do |i|
115
+ expect(subject).to receive(:sleep).once.with(s * (2 ** i)).ordered
116
+ end
117
+ expect do
118
+ subject.retryable(:tries => n, :base_sleep => s, :max_sleep => 100){raise E}
119
+ end.to raise_error(E)
120
+ end
121
+
122
+ it "should execute once and retry n times with exponential backoff sleep capping at max_sleep" do
123
+ n = 20
124
+ base_sleep = 0.1
125
+ max_sleep = 1
126
+
127
+ expect(subject).to receive(:sleep).once.with(0.1).ordered
128
+ expect(subject).to receive(:sleep).once.with(0.2).ordered
129
+ expect(subject).to receive(:sleep).once.with(0.4).ordered
130
+ expect(subject).to receive(:sleep).once.with(0.8).ordered
131
+ (n - 4).times.each do |i|
132
+ expect(subject).to receive(:sleep).once.with(1).ordered
133
+ end
134
+ expect do
135
+ subject.retryable(:tries => n, :base_sleep => base_sleep, :max_sleep => max_sleep){raise E}
136
+ end.to raise_error(E)
137
+ end
138
+ end
139
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc1
4
+ version: 2.0.1
5
5
  platform: java
6
6
  authors:
7
7
  - Jordan Sissel
@@ -10,190 +10,190 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-10-22 00:00:00.000000000 Z
13
+ date: 2015-11-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: cabin
17
- version_requirements: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: 0.7.0
22
16
  requirement: !ruby/object:Gem::Requirement
23
17
  requirements:
24
18
  - - ~>
25
19
  - !ruby/object:Gem::Version
26
20
  version: 0.7.0
21
+ name: cabin
27
22
  prerelease: false
28
23
  type: :runtime
29
- - !ruby/object:Gem::Dependency
30
- name: pry
31
24
  version_requirements: !ruby/object:Gem::Requirement
32
25
  requirements:
33
26
  - - ~>
34
27
  - !ruby/object:Gem::Version
35
- version: 0.10.1
28
+ version: 0.7.0
29
+ - !ruby/object:Gem::Dependency
36
30
  requirement: !ruby/object:Gem::Requirement
37
31
  requirements:
38
32
  - - ~>
39
33
  - !ruby/object:Gem::Version
40
34
  version: 0.10.1
35
+ name: pry
41
36
  prerelease: false
42
37
  type: :runtime
43
- - !ruby/object:Gem::Dependency
44
- name: stud
45
38
  version_requirements: !ruby/object:Gem::Requirement
46
39
  requirements:
47
40
  - - ~>
48
41
  - !ruby/object:Gem::Version
49
- version: 0.0.19
42
+ version: 0.10.1
43
+ - !ruby/object:Gem::Dependency
50
44
  requirement: !ruby/object:Gem::Requirement
51
45
  requirements:
52
46
  - - ~>
53
47
  - !ruby/object:Gem::Version
54
48
  version: 0.0.19
49
+ name: stud
55
50
  prerelease: false
56
51
  type: :runtime
57
- - !ruby/object:Gem::Dependency
58
- name: clamp
59
52
  version_requirements: !ruby/object:Gem::Requirement
60
53
  requirements:
61
54
  - - ~>
62
55
  - !ruby/object:Gem::Version
63
- version: 0.6.5
56
+ version: 0.0.19
57
+ - !ruby/object:Gem::Dependency
64
58
  requirement: !ruby/object:Gem::Requirement
65
59
  requirements:
66
60
  - - ~>
67
61
  - !ruby/object:Gem::Version
68
62
  version: 0.6.5
63
+ name: clamp
69
64
  prerelease: false
70
65
  type: :runtime
71
- - !ruby/object:Gem::Dependency
72
- name: filesize
73
66
  version_requirements: !ruby/object:Gem::Requirement
74
67
  requirements:
75
- - - '='
68
+ - - ~>
76
69
  - !ruby/object:Gem::Version
77
- version: 0.0.4
70
+ version: 0.6.5
71
+ - !ruby/object:Gem::Dependency
78
72
  requirement: !ruby/object:Gem::Requirement
79
73
  requirements:
80
74
  - - '='
81
75
  - !ruby/object:Gem::Version
82
76
  version: 0.0.4
77
+ name: filesize
83
78
  prerelease: false
84
79
  type: :runtime
85
- - !ruby/object:Gem::Dependency
86
- name: gems
87
80
  version_requirements: !ruby/object:Gem::Requirement
88
81
  requirements:
89
- - - ~>
82
+ - - '='
90
83
  - !ruby/object:Gem::Version
91
- version: 0.8.3
84
+ version: 0.0.4
85
+ - !ruby/object:Gem::Dependency
92
86
  requirement: !ruby/object:Gem::Requirement
93
87
  requirements:
94
88
  - - ~>
95
89
  - !ruby/object:Gem::Version
96
90
  version: 0.8.3
91
+ name: gems
97
92
  prerelease: false
98
93
  type: :runtime
99
- - !ruby/object:Gem::Dependency
100
- name: concurrent-ruby
101
94
  version_requirements: !ruby/object:Gem::Requirement
102
95
  requirements:
103
96
  - - ~>
104
97
  - !ruby/object:Gem::Version
105
- version: 0.9.1
98
+ version: 0.8.3
99
+ - !ruby/object:Gem::Dependency
106
100
  requirement: !ruby/object:Gem::Requirement
107
101
  requirements:
108
- - - ~>
102
+ - - '='
109
103
  - !ruby/object:Gem::Version
110
- version: 0.9.1
104
+ version: 0.9.2
105
+ name: concurrent-ruby
111
106
  prerelease: false
112
107
  type: :runtime
113
- - !ruby/object:Gem::Dependency
114
- name: jruby-openssl
115
108
  version_requirements: !ruby/object:Gem::Requirement
116
109
  requirements:
117
- - - '>='
110
+ - - '='
118
111
  - !ruby/object:Gem::Version
119
- version: 0.9.11
112
+ version: 0.9.2
113
+ - !ruby/object:Gem::Dependency
120
114
  requirement: !ruby/object:Gem::Requirement
121
115
  requirements:
122
116
  - - '>='
123
117
  - !ruby/object:Gem::Version
124
118
  version: 0.9.11
119
+ name: jruby-openssl
125
120
  prerelease: false
126
121
  type: :runtime
127
- - !ruby/object:Gem::Dependency
128
- name: treetop
129
122
  version_requirements: !ruby/object:Gem::Requirement
130
123
  requirements:
131
- - - <
124
+ - - '>='
132
125
  - !ruby/object:Gem::Version
133
- version: 1.5.0
126
+ version: 0.9.11
127
+ - !ruby/object:Gem::Dependency
134
128
  requirement: !ruby/object:Gem::Requirement
135
129
  requirements:
136
130
  - - <
137
131
  - !ruby/object:Gem::Version
138
132
  version: 1.5.0
133
+ name: treetop
139
134
  prerelease: false
140
135
  type: :runtime
141
- - !ruby/object:Gem::Dependency
142
- name: i18n
143
136
  version_requirements: !ruby/object:Gem::Requirement
144
137
  requirements:
145
- - - '='
138
+ - - <
146
139
  - !ruby/object:Gem::Version
147
- version: 0.6.9
140
+ version: 1.5.0
141
+ - !ruby/object:Gem::Dependency
148
142
  requirement: !ruby/object:Gem::Requirement
149
143
  requirements:
150
144
  - - '='
151
145
  - !ruby/object:Gem::Version
152
146
  version: 0.6.9
147
+ name: i18n
153
148
  prerelease: false
154
149
  type: :runtime
155
- - !ruby/object:Gem::Dependency
156
- name: minitar
157
150
  version_requirements: !ruby/object:Gem::Requirement
158
151
  requirements:
159
- - - ~>
152
+ - - '='
160
153
  - !ruby/object:Gem::Version
161
- version: 0.5.4
154
+ version: 0.6.9
155
+ - !ruby/object:Gem::Dependency
162
156
  requirement: !ruby/object:Gem::Requirement
163
157
  requirements:
164
158
  - - ~>
165
159
  - !ruby/object:Gem::Version
166
160
  version: 0.5.4
161
+ name: minitar
167
162
  prerelease: false
168
163
  type: :runtime
169
- - !ruby/object:Gem::Dependency
170
- name: thread_safe
171
164
  version_requirements: !ruby/object:Gem::Requirement
172
165
  requirements:
173
166
  - - ~>
174
167
  - !ruby/object:Gem::Version
175
- version: 0.3.5
168
+ version: 0.5.4
169
+ - !ruby/object:Gem::Dependency
176
170
  requirement: !ruby/object:Gem::Requirement
177
171
  requirements:
178
172
  - - ~>
179
173
  - !ruby/object:Gem::Version
180
174
  version: 0.3.5
175
+ name: thread_safe
181
176
  prerelease: false
182
177
  type: :runtime
183
- - !ruby/object:Gem::Dependency
184
- name: jrjackson
185
178
  version_requirements: !ruby/object:Gem::Requirement
186
179
  requirements:
187
180
  - - ~>
188
181
  - !ruby/object:Gem::Version
189
- version: 0.3.6
182
+ version: 0.3.5
183
+ - !ruby/object:Gem::Dependency
190
184
  requirement: !ruby/object:Gem::Requirement
191
185
  requirements:
192
186
  - - ~>
193
187
  - !ruby/object:Gem::Version
194
- version: 0.3.6
188
+ version: 0.3.7
189
+ name: jrjackson
195
190
  prerelease: false
196
191
  type: :runtime
192
+ version_requirements: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ~>
195
+ - !ruby/object:Gem::Version
196
+ version: 0.3.7
197
197
  description: The core components of logstash, the scalable log and event management tool
198
198
  email:
199
199
  - jls@semicomplete.com
@@ -230,7 +230,6 @@ files:
230
230
  - lib/logstash/patches/cabin.rb
231
231
  - lib/logstash/patches/profile_require_calls.rb
232
232
  - lib/logstash/patches/rubygems.rb
233
- - lib/logstash/patches/silence_concurrent_ruby_warning.rb
234
233
  - lib/logstash/patches/stronger_openssl_defaults.rb
235
234
  - lib/logstash/pipeline.rb
236
235
  - lib/logstash/plugin.rb
@@ -288,6 +287,7 @@ files:
288
287
  - spec/util/java_version_spec.rb
289
288
  - spec/util/json_spec.rb
290
289
  - spec/util/plugin_version_spec.rb
290
+ - spec/util/retryable_spec.rb
291
291
  - spec/util/unicode_trimmer_spec.rb
292
292
  - spec/util/worker_threads_default_printer_spec.rb
293
293
  - spec/util_spec.rb
@@ -306,9 +306,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
306
306
  version: '0'
307
307
  required_rubygems_version: !ruby/object:Gem::Requirement
308
308
  requirements:
309
- - - '>'
309
+ - - '>='
310
310
  - !ruby/object:Gem::Version
311
- version: 1.3.1
311
+ version: '0'
312
312
  requirements: []
313
313
  rubyforge_project:
314
314
  rubygems_version: 2.4.5
@@ -346,6 +346,7 @@ test_files:
346
346
  - spec/util/java_version_spec.rb
347
347
  - spec/util/json_spec.rb
348
348
  - spec/util/plugin_version_spec.rb
349
+ - spec/util/retryable_spec.rb
349
350
  - spec/util/unicode_trimmer_spec.rb
350
351
  - spec/util/worker_threads_default_printer_spec.rb
351
352
  - spec/util_spec.rb
@@ -1,54 +0,0 @@
1
- # encoding: utf-8
2
- require "logstash/namespace"
3
- require "concurrent/concern/logging"
4
- require "concurrent/concern/deprecation"
5
- require "concurrent/version"
6
- require "cabin"
7
-
8
- # Concurrent-ruby is throwing warning when the code is run under jdk7, and they
9
- # will provide best effort support, logstash has to support JDK7 for a few months.
10
- #
11
- # By default all deprecation warnings of the concurrent ruby
12
- # library use the `WARN` level which is show everytime we boot logstash,
13
- # This monkeypatch change the log level of the deprecation warning to be `debug`
14
- # instead. This monkey patch might be a bit over kill but there is no
15
- # easy way to override the java version check.
16
- #
17
- # ref: https://github.com/ruby-concurrency/concurrent-ruby/blob/v0.9.1/lib/concurrent/configuration.rb#L284-L295
18
- #
19
- # This patch is only valid for 0.9.1
20
- if Concurrent::VERSION == "0.9.1"
21
- module Concurrent
22
- module Concern
23
- module Deprecation
24
- include Concern::Logging
25
-
26
- def deprecated(message, strip = 2)
27
- caller_line = caller(strip).first if strip > 0
28
- klass = if Module === self
29
- self
30
- else
31
- self.class
32
- end
33
- message = if strip > 0
34
- format("[DEPRECATED] %s\ncalled on: %s", message, caller_line)
35
- else
36
- format('[DEPRECATED] %s', message)
37
- end
38
-
39
- # lets use our logger
40
- logger = Cabin::Channel.get(LogStash)
41
- logger.debug(message, :class => klass.to_s)
42
- end
43
-
44
- extend self
45
- end
46
- end
47
- end
48
- else
49
- # This is added a guard to check if we need to update this code or not.
50
- # Keep in mind, the latest releases of concurrent-ruby brokes a few stuff.
51
- #
52
- # Even the latest master version changed how they handle deprecation.
53
- raise "Logstash expects concurrent-ruby version 0.9.1 and version #{Concurrent::VERSION} is installed, please verify this patch: #{__FILE__}"
54
- end