logstash-core 2.2.0.snapshot3-java → 2.2.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 +4 -4
- data/lib/logstash-core/version.rb +1 -1
- data/lib/logstash/agent.rb +14 -4
- data/lib/logstash/pipeline.rb +24 -6
- data/lib/logstash/util.rb +1 -1
- data/lib/logstash/version.rb +1 -1
- data/locales/en.yml +2 -0
- data/logstash-core.gemspec +1 -1
- data/spec/logstash/pipeline_spec.rb +18 -0
- data/spec/logstash/plugin_spec.rb +18 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79aea5801f122b108d1bf5348fc9161415f30c16
|
4
|
+
data.tar.gz: b067b5351bc10d6d90dfdda009befbb27ed619d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a59cd791e6a4c185d25cf3ad398d9e75dc65b437e0bcc8509a9ba4a7ef9d6d7364179352ff98fce94f1e49123ab3dc2c5192fefa91d25dd02ffd3f895f39059c
|
7
|
+
data.tar.gz: b28cffde1b401b6a097c3d5c7332003eb9023a91a6e2c7233fc2bdc27cc925946929bbf82b84d5012b545abcafdd81fed76c327382b43167a0e7c5a8249c485f
|
data/lib/logstash/agent.rb
CHANGED
@@ -22,21 +22,24 @@ class LogStash::Agent < Clamp::Command
|
|
22
22
|
:default => "", :attribute_name => :config_string
|
23
23
|
|
24
24
|
option ["-w", "--pipeline-workers"], "COUNT",
|
25
|
-
I18n.t("logstash.
|
25
|
+
I18n.t("logstash.agent.flag.pipeline-workers"),
|
26
26
|
:attribute_name => :pipeline_workers,
|
27
27
|
:default => LogStash::Pipeline::DEFAULT_SETTINGS[:default_pipeline_workers]
|
28
28
|
|
29
|
-
|
30
29
|
option ["-b", "--pipeline-batch-size"], "SIZE",
|
31
|
-
I18n.t("logstash.
|
30
|
+
I18n.t("logstash.agent.flag.pipeline-batch-size"),
|
32
31
|
:attribute_name => :pipeline_batch_size,
|
33
32
|
:default => LogStash::Pipeline::DEFAULT_SETTINGS[:pipeline_batch_size]
|
34
33
|
|
35
34
|
option ["-u", "--pipeline-batch-delay"], "DELAY_IN_MS",
|
36
|
-
I18n.t("logstash.
|
35
|
+
I18n.t("logstash.agent.flag.pipeline-batch-delay"),
|
37
36
|
:attribute_name => :pipeline_batch_delay,
|
38
37
|
:default => LogStash::Pipeline::DEFAULT_SETTINGS[:pipeline_batch_delay]
|
39
38
|
|
39
|
+
option ["--filterworkers"], "COUNT",
|
40
|
+
I18n.t("logstash.agent.flag.filterworkers"),
|
41
|
+
:attribute_name => :filter_workers
|
42
|
+
|
40
43
|
option ["-l", "--log"], "FILE",
|
41
44
|
I18n.t("logstash.agent.flag.log"),
|
42
45
|
:attribute_name => :log_file
|
@@ -135,6 +138,12 @@ class LogStash::Agent < Clamp::Command
|
|
135
138
|
end
|
136
139
|
configure
|
137
140
|
|
141
|
+
|
142
|
+
if filter_workers
|
143
|
+
@logger.warn("--filter-workers is deprecated! Please use --pipeline-workers or -w. This setting will be removed in the next major version!")
|
144
|
+
self.pipeline_workers = filter_workers
|
145
|
+
end
|
146
|
+
|
138
147
|
# You must specify a config_string or config_path
|
139
148
|
if @config_string.nil? && @config_path.nil?
|
140
149
|
fail(help + "\n" + I18n.t("logstash.agent.missing-configuration"))
|
@@ -158,6 +167,7 @@ class LogStash::Agent < Clamp::Command
|
|
158
167
|
end
|
159
168
|
end
|
160
169
|
|
170
|
+
|
161
171
|
begin
|
162
172
|
pipeline = LogStash::Pipeline.new(@config_string, @pipeline_settings)
|
163
173
|
rescue LoadError => e
|
data/lib/logstash/pipeline.rb
CHANGED
@@ -72,8 +72,6 @@ module LogStash; class Pipeline
|
|
72
72
|
@ready = Concurrent::AtomicBoolean.new(false)
|
73
73
|
@running = Concurrent::AtomicBoolean.new(false)
|
74
74
|
@flushing = Concurrent::AtomicReference.new(false)
|
75
|
-
|
76
|
-
start_flusher
|
77
75
|
end # def initialize
|
78
76
|
|
79
77
|
def ready?
|
@@ -130,9 +128,10 @@ module LogStash; class Pipeline
|
|
130
128
|
# Block until all inputs have stopped
|
131
129
|
# Generally this happens if SIGINT is sent and `shutdown` is called from an external thread
|
132
130
|
|
133
|
-
|
131
|
+
transition_to_running
|
132
|
+
start_flusher # Launches a non-blocking thread for flush events
|
134
133
|
wait_inputs
|
135
|
-
|
134
|
+
transition_to_stopped
|
136
135
|
|
137
136
|
@logger.info("Input plugins stopped! Will shutdown filter/output workers.")
|
138
137
|
|
@@ -146,6 +145,22 @@ module LogStash; class Pipeline
|
|
146
145
|
return 0
|
147
146
|
end # def run
|
148
147
|
|
148
|
+
def transition_to_running
|
149
|
+
@running.make_true
|
150
|
+
end
|
151
|
+
|
152
|
+
def transition_to_stopped
|
153
|
+
@running.make_false
|
154
|
+
end
|
155
|
+
|
156
|
+
def running?
|
157
|
+
@running.true?
|
158
|
+
end
|
159
|
+
|
160
|
+
def stopped?
|
161
|
+
@running.false?
|
162
|
+
end
|
163
|
+
|
149
164
|
def start_workers
|
150
165
|
@inflight_batches = {}
|
151
166
|
|
@@ -415,10 +430,13 @@ module LogStash; class Pipeline
|
|
415
430
|
end
|
416
431
|
|
417
432
|
def start_flusher
|
433
|
+
# Invariant to help detect improper initialization
|
434
|
+
raise "Attempted to start flusher on a stopped pipeline!" if stopped?
|
435
|
+
|
418
436
|
@flusher_thread = Thread.new do
|
419
|
-
while Stud.stoppable_sleep(5, 0.1) {
|
437
|
+
while Stud.stoppable_sleep(5, 0.1) { stopped? }
|
420
438
|
flush
|
421
|
-
break if
|
439
|
+
break if stopped?
|
422
440
|
end
|
423
441
|
end
|
424
442
|
end
|
data/lib/logstash/util.rb
CHANGED
data/lib/logstash/version.rb
CHANGED
data/locales/en.yml
CHANGED
@@ -157,6 +157,8 @@ en:
|
|
157
157
|
Check configuration for valid syntax and then exit.
|
158
158
|
pipeline-workers: |+
|
159
159
|
Sets the number of pipeline workers to run.
|
160
|
+
filterworkers: |+
|
161
|
+
DEPRECATED. Now an alias for --pipeline-workers and -w
|
160
162
|
pipeline-batch-size: |+
|
161
163
|
Size of batches the pipeline is to work in.
|
162
164
|
pipeline-batch-delay: |+
|
data/logstash-core.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.require_paths = ["lib"]
|
18
18
|
gem.version = LOGSTASH_CORE_VERSION
|
19
19
|
|
20
|
-
gem.add_runtime_dependency "logstash-core-event", "~> 2.2.
|
20
|
+
gem.add_runtime_dependency "logstash-core-event", "~> 2.2.1"
|
21
21
|
|
22
22
|
gem.add_runtime_dependency "cabin", "~> 0.7.0" #(Apache 2.0 license)
|
23
23
|
gem.add_runtime_dependency "pry", "~> 0.10.1" #(Ruby license)
|
@@ -232,6 +232,24 @@ describe LogStash::Pipeline do
|
|
232
232
|
end
|
233
233
|
|
234
234
|
context "compiled flush function" do
|
235
|
+
describe "flusher thread" do
|
236
|
+
before(:each) do
|
237
|
+
allow(LogStash::Plugin).to receive(:lookup).with("input", "dummyinput").and_return(DummyInput)
|
238
|
+
allow(LogStash::Plugin).to receive(:lookup).with("codec", "plain").and_return(DummyCodec)
|
239
|
+
allow(LogStash::Plugin).to receive(:lookup).with("output", "dummyoutput").and_return(DummyOutput)
|
240
|
+
end
|
241
|
+
|
242
|
+
let(:config) { "input { dummyinput {} } output { dummyoutput {} }"}
|
243
|
+
|
244
|
+
it "should start the flusher thread only after the pipeline is running" do
|
245
|
+
pipeline = TestPipeline.new(config)
|
246
|
+
|
247
|
+
expect(pipeline).to receive(:transition_to_running).ordered.and_call_original
|
248
|
+
expect(pipeline).to receive(:start_flusher).ordered.and_call_original
|
249
|
+
|
250
|
+
pipeline.run
|
251
|
+
end
|
252
|
+
end
|
235
253
|
|
236
254
|
context "cancelled events should not propagate down the filters" do
|
237
255
|
config <<-CONFIG
|
@@ -144,9 +144,26 @@ describe LogStash::Plugin do
|
|
144
144
|
].each do |klass|
|
145
145
|
|
146
146
|
it "subclass #{klass.name} does not modify params" do
|
147
|
-
|
147
|
+
klass.new(args)
|
148
148
|
expect(args).to be_empty
|
149
149
|
end
|
150
150
|
end
|
151
|
+
|
152
|
+
context "codec initialization" do
|
153
|
+
|
154
|
+
class LogStash::Codecs::Noop < LogStash::Codecs::Base
|
155
|
+
config_name "noop"
|
156
|
+
|
157
|
+
config :format, :validate => :string
|
158
|
+
def register; end
|
159
|
+
end
|
160
|
+
|
161
|
+
it "should only register once" do
|
162
|
+
args = { "codec" => LogStash::Codecs::Noop.new("format" => ".") }
|
163
|
+
expect_any_instance_of(LogStash::Codecs::Noop).to receive(:register).once
|
164
|
+
LogStash::Plugin.new(args)
|
165
|
+
end
|
166
|
+
|
167
|
+
end
|
151
168
|
end
|
152
169
|
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.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Jordan Sissel
|
@@ -10,14 +10,14 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-02-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 2.2.
|
20
|
+
version: 2.2.1
|
21
21
|
name: logstash-core-event
|
22
22
|
prerelease: false
|
23
23
|
type: :runtime
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 2.2.
|
28
|
+
version: 2.2.1
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
@@ -327,9 +327,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
327
327
|
version: '0'
|
328
328
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
329
329
|
requirements:
|
330
|
-
- - '
|
330
|
+
- - '>='
|
331
331
|
- !ruby/object:Gem::Version
|
332
|
-
version:
|
332
|
+
version: '0'
|
333
333
|
requirements: []
|
334
334
|
rubyforge_project:
|
335
335
|
rubygems_version: 2.4.5
|