logstash-core 1.5.0.rc4.snapshot1-java → 1.5.0.rc4.snapshot2-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: 3f61653420801a9a84cdd426bb71450762c6fe34
4
- data.tar.gz: 81c20f44de45afb382a4591b21ce770c56d6c566
3
+ metadata.gz: 4c172a7e60e5b827f266a9c31118630f53af974b
4
+ data.tar.gz: 4e60b82765c5e3bb2a34533edc8ec5cec562708f
5
5
  SHA512:
6
- metadata.gz: e217427a37fa38b8e942a82d1848a83e1cbf495535dd523ee316e708107dbfa50ae8a6e9104ce297bda8f51018a10cb36690326840d3ea5ff6bf0774bba5d59c
7
- data.tar.gz: 181ad60293edf7793cc8a1538df77654f5d620fc116befd8ac660fd226310b6b21032226ac6ce79bb6a0ec6a8e6432dc726f4259959779775af7fdac247ee4c3
6
+ metadata.gz: 4623f3461e89f628f0557c3659cbea9fd64dc5a2269703582cd85190db6d68c5bf6692ca890b3467cecce0d1aeb69c525781102237ec45c24db4ff5021381dd9
7
+ data.tar.gz: 25734226e0102e256893c616de68b03a9fe7b23f4404b77652a6359b69140898fe355b8414c8ecc4664247fe285f1bf2ec12b7602ed43370ce688ea2084dc6e5
@@ -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
- unless LogStash::Environment.const_defined?("LOGSTASH_HOME")
10
- abort("ERROR: missing LOGSTASH_HOME environment variable") if ENV["LOGSTASH_HOME"].to_s.empty?
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
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  # The version of logstash.
3
- LOGSTASH_VERSION = "1.5.0.rc4.snapshot1"
3
+ LOGSTASH_VERSION = "1.5.0.rc4.snapshot2"
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.
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.snapshot1
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-04 00:00:00.000000000 Z
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
@@ -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