logstash-core 1.5.0.rc4.snapshot1-java → 1.5.0.rc4.snapshot2-java
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.
Potentially problematic release.
This version of logstash-core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/logstash/environment.rb +2 -5
- data/lib/logstash/version.rb +1 -1
- metadata +2 -4
- data/spec/util/retryable_spec.rb +0 -145
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c172a7e60e5b827f266a9c31118630f53af974b
|
4
|
+
data.tar.gz: 4e60b82765c5e3bb2a34533edc8ec5cec562708f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4623f3461e89f628f0557c3659cbea9fd64dc5a2269703582cd85190db6d68c5bf6692ca890b3467cecce0d1aeb69c525781102237ec45c24db4ff5021381dd9
|
7
|
+
data.tar.gz: 25734226e0102e256893c616de68b03a9fe7b23f4404b77652a6359b69140898fe355b8414c8ecc4664247fe285f1bf2ec12b7602ed43370ce688ea2084dc6e5
|
data/lib/logstash/environment.rb
CHANGED
@@ -6,16 +6,13 @@ module LogStash
|
|
6
6
|
extend self
|
7
7
|
|
8
8
|
# rehydrate the bootstrap environment if the startup was not done by executing bootstrap.rb
|
9
|
-
|
10
|
-
|
9
|
+
# and we are in the context of the logstash package
|
10
|
+
if !LogStash::Environment.const_defined?("LOGSTASH_HOME") && !ENV["LOGSTASH_HOME"].to_s.empty?
|
11
11
|
$LOAD_PATH << ::File.join(ENV["LOGSTASH_HOME"], "lib")
|
12
12
|
require "bootstrap/environment"
|
13
13
|
end
|
14
14
|
|
15
15
|
LOGSTASH_CORE = ::File.expand_path(::File.join(::File.dirname(__FILE__), "..", ".."))
|
16
|
-
BUNDLE_CONFIG_PATH = ::File.join(LOGSTASH_HOME, ".bundle", "config")
|
17
|
-
BOOTSTRAP_GEM_PATH = ::File.join(LOGSTASH_HOME, 'build', 'bootstrap')
|
18
|
-
|
19
16
|
LOGSTASH_ENV = (ENV["LS_ENV"] || 'production').to_s.freeze
|
20
17
|
|
21
18
|
def env
|
data/lib/logstash/version.rb
CHANGED
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: 1.5.0.rc4.
|
4
|
+
version: 1.5.0.rc4.snapshot2
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Jordan Sissel
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-05-
|
13
|
+
date: 2015-05-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: cabin
|
@@ -245,7 +245,6 @@ files:
|
|
245
245
|
- spec/util/gemfile_spec.rb
|
246
246
|
- spec/util/json_spec.rb
|
247
247
|
- spec/util/plugin_version_spec.rb
|
248
|
-
- spec/util/retryable_spec.rb
|
249
248
|
- spec/util_spec.rb
|
250
249
|
homepage: http://www.elastic.co/guide/en/logstash/current/index.html
|
251
250
|
licenses:
|
@@ -294,5 +293,4 @@ test_files:
|
|
294
293
|
- spec/util/gemfile_spec.rb
|
295
294
|
- spec/util/json_spec.rb
|
296
295
|
- spec/util/plugin_version_spec.rb
|
297
|
-
- spec/util/retryable_spec.rb
|
298
296
|
- spec/util_spec.rb
|
data/spec/util/retryable_spec.rb
DELETED
@@ -1,145 +0,0 @@
|
|
1
|
-
require "logstash/util/retryable"
|
2
|
-
require "insist"
|
3
|
-
|
4
|
-
describe LogStash::Retryable do
|
5
|
-
class C
|
6
|
-
include LogStash::Retryable
|
7
|
-
end
|
8
|
-
|
9
|
-
class E < StandardError; end;
|
10
|
-
class F < StandardError; end;
|
11
|
-
|
12
|
-
subject do
|
13
|
-
C.new.tap do |c|
|
14
|
-
c.stub(:sleep)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
context "with default fixed 1 second retry sleep" do
|
19
|
-
|
20
|
-
it "should execute once" do
|
21
|
-
subject.should_receive(:sleep).never
|
22
|
-
expect(subject.retryable(:rescue => nil){|i| expect(i).to eq(0); "foo"}).to eq("foo")
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should not retry on non rescued exceptions" do
|
26
|
-
i = 0
|
27
|
-
subject.should_receive(:sleep).never
|
28
|
-
expect{subject.retryable(:rescue => E){ i += 1; raise F}}.to raise_error(F)
|
29
|
-
expect(i).to eq(1)
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should execute once and retry once by default" do
|
33
|
-
i = 0
|
34
|
-
subject.should_receive(:sleep).once.with(1)
|
35
|
-
expect{subject.retryable{i += 1; raise E}}.to raise_error(E)
|
36
|
-
expect(i).to eq(2)
|
37
|
-
end
|
38
|
-
|
39
|
-
it "should retry on rescued exceptions" do
|
40
|
-
i = 0
|
41
|
-
subject.should_receive(:sleep).once.with(1)
|
42
|
-
expect{subject.retryable(:rescue => E){ i += 1; raise E}}.to raise_error(E)
|
43
|
-
expect(i).to eq(2)
|
44
|
-
end
|
45
|
-
|
46
|
-
it "should retry indefinitely" do
|
47
|
-
i = 0
|
48
|
-
subject.should_receive(:sleep).exactly(50).times.with(1)
|
49
|
-
expect{subject.retryable(:tries => 0, :rescue => E){ i += 1; raise i <= 50 ? E : F}}.to raise_error(F)
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should execute once and retry once by default and execute on_retry callback" do
|
53
|
-
i = 0
|
54
|
-
callback_values = []
|
55
|
-
|
56
|
-
callback = lambda do |retry_count, e|
|
57
|
-
callback_values << [retry_count, e]
|
58
|
-
end
|
59
|
-
|
60
|
-
subject.should_receive(:sleep).once.with(1)
|
61
|
-
|
62
|
-
expect do
|
63
|
-
subject.retryable(:on_retry => callback){i += 1; raise E}
|
64
|
-
end.to raise_error
|
65
|
-
|
66
|
-
expect(i).to eq(2)
|
67
|
-
|
68
|
-
expect(callback_values.size).to eq(1)
|
69
|
-
expect(callback_values[0][0]).to eq(1)
|
70
|
-
expect(callback_values[0][1]).to be_a(E)
|
71
|
-
end
|
72
|
-
|
73
|
-
it "should execute once and retry n times" do
|
74
|
-
i = 0
|
75
|
-
n = 3
|
76
|
-
subject.should_receive(:sleep).exactly(n).times.with(1)
|
77
|
-
expect{subject.retryable(:tries => n){i += 1; raise E}}.to raise_error(E)
|
78
|
-
expect(i).to eq(n + 1)
|
79
|
-
end
|
80
|
-
|
81
|
-
it "should execute once and retry n times and execute on_retry callback" do
|
82
|
-
i = 0
|
83
|
-
n = 3
|
84
|
-
callback_values = []
|
85
|
-
|
86
|
-
callback = lambda do |retry_count, e|
|
87
|
-
callback_values << [retry_count, e]
|
88
|
-
end
|
89
|
-
|
90
|
-
subject.should_receive(:sleep).exactly(n).times.with(1)
|
91
|
-
|
92
|
-
expect do
|
93
|
-
subject.retryable(:tries => n, :on_retry => callback){i += 1; raise E}
|
94
|
-
end.to raise_error
|
95
|
-
|
96
|
-
expect(i).to eq(n + 1)
|
97
|
-
|
98
|
-
expect(callback_values.size).to eq(n)
|
99
|
-
n.times.each do |j|
|
100
|
-
expect(callback_values[j].first).to eq(j + 1)
|
101
|
-
expect(callback_values[j].last).to be_a(E)
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
context "with exponential backoff" do
|
107
|
-
|
108
|
-
it "should execute once and retry once with base sleep by default" do
|
109
|
-
subject.should_receive(:sleep).once.with(2)
|
110
|
-
expect do
|
111
|
-
subject.retryable(:base_sleep => 2, :max_sleep => 10){raise E}
|
112
|
-
end.to raise_error(E)
|
113
|
-
end
|
114
|
-
|
115
|
-
it "should execute once and retry n times with exponential backoff sleep" do
|
116
|
-
n = 3
|
117
|
-
s = 0.5
|
118
|
-
|
119
|
-
n.times.each do |i|
|
120
|
-
subject.should_receive(:sleep).once.with(s * (2 ** i)).ordered
|
121
|
-
end
|
122
|
-
expect do
|
123
|
-
subject.retryable(:tries => n, :base_sleep => s, :max_sleep => 100){raise E}
|
124
|
-
end.to raise_error(E)
|
125
|
-
end
|
126
|
-
|
127
|
-
it "should execute once and retry n times with exponential backoff sleep capping at max_sleep" do
|
128
|
-
n = 20
|
129
|
-
base_sleep = 0.1
|
130
|
-
max_sleep = 1
|
131
|
-
|
132
|
-
subject.should_receive(:sleep).once.with(0.1).ordered
|
133
|
-
subject.should_receive(:sleep).once.with(0.2).ordered
|
134
|
-
subject.should_receive(:sleep).once.with(0.4).ordered
|
135
|
-
subject.should_receive(:sleep).once.with(0.8).ordered
|
136
|
-
(n - 4).times.each do |i|
|
137
|
-
subject.should_receive(:sleep).once.with(1).ordered
|
138
|
-
end
|
139
|
-
expect do
|
140
|
-
subject.retryable(:tries => n, :base_sleep => base_sleep, :max_sleep => max_sleep){raise E}
|
141
|
-
end.to raise_error(E)
|
142
|
-
end
|
143
|
-
end
|
144
|
-
|
145
|
-
end
|