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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7857e5445f210282edca3adc2180baaa618e37b
4
- data.tar.gz: fc225f76018d011dbd0ae2b03cc8245df78f1293
3
+ metadata.gz: 79aea5801f122b108d1bf5348fc9161415f30c16
4
+ data.tar.gz: b067b5351bc10d6d90dfdda009befbb27ed619d8
5
5
  SHA512:
6
- metadata.gz: 86be18d25f189e0a406cfa846b57cdf4c14ff9375e115304fd11e0ce26ed4d9810db88ebc019e8c3850a1dd8be76a2df3f8c84750cb7929450a19f27e00c35f1
7
- data.tar.gz: a83f30280dc94bd6580af794436fc0055c4d3e0677f54d25d5cb70d839d197f950f094e9e6cedba79cc3d6ef22f013d479cf80153af448ddab664d4faa142cf8
6
+ metadata.gz: a59cd791e6a4c185d25cf3ad398d9e75dc65b437e0bcc8509a9ba4a7ef9d6d7364179352ff98fce94f1e49123ab3dc2c5192fefa91d25dd02ffd3f895f39059c
7
+ data.tar.gz: b28cffde1b401b6a097c3d5c7332003eb9023a91a6e2c7233fc2bdc27cc925946929bbf82b84d5012b545abcafdd81fed76c327382b43167a0e7c5a8249c485f
@@ -5,4 +5,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.
7
7
 
8
- LOGSTASH_CORE_VERSION = "2.2.0.snapshot3"
8
+ LOGSTASH_CORE_VERSION = "2.2.1"
@@ -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.runner.flag.pipeline-workers"),
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.runner.flag.pipeline-batch-size"),
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.runner.flag.pipeline-batch-delay"),
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
@@ -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
- @running.make_true
131
+ transition_to_running
132
+ start_flusher # Launches a non-blocking thread for flush events
134
133
  wait_inputs
135
- @running.make_false
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) { @running.false? }
437
+ while Stud.stoppable_sleep(5, 0.1) { stopped? }
420
438
  flush
421
- break if @running.false?
439
+ break if stopped?
422
440
  end
423
441
  end
424
442
  end
data/lib/logstash/util.rb CHANGED
@@ -193,7 +193,7 @@ module LogStash::Util
193
193
  when Fixnum, Symbol, IO, TrueClass, FalseClass, NilClass
194
194
  o
195
195
  when LogStash::Codecs::Base
196
- o.clone.tap {|c| c.register }
196
+ o.clone
197
197
  when String
198
198
  o.clone #need to keep internal state e.g. frozen
199
199
  else
@@ -11,4 +11,4 @@
11
11
  # eventually this file should be in the root logstash lib fir and dependencies in logstash-core should be
12
12
  # fixed.
13
13
 
14
- LOGSTASH_VERSION = "2.2.0.snapshot3"
14
+ LOGSTASH_VERSION = "2.2.1"
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: |+
@@ -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.0.snapshot3"
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
- instance = klass.new(args)
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.0.snapshot3
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-01-14 00:00:00.000000000 Z
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.0.snapshot3
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.0.snapshot3
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: 1.3.1
332
+ version: '0'
333
333
  requirements: []
334
334
  rubyforge_project:
335
335
  rubygems_version: 2.4.5