logstash-core 5.5.1.snapshot1-java → 5.5.2-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.
- checksums.yaml +4 -4
- data/lib/logstash-core/logstash-core.jar +0 -0
- data/lib/logstash-core/version.rb +1 -1
- data/lib/logstash/agent.rb +5 -5
- data/lib/logstash/api/commands/default_metadata.rb +1 -1
- data/lib/logstash/api/commands/hot_threads_reporter.rb +8 -2
- data/lib/logstash/runner.rb +1 -1
- data/lib/logstash/util/thread_dump.rb +4 -3
- data/lib/logstash/util/wrapped_acked_queue.rb +5 -1
- data/lib/logstash/version.rb +1 -1
- data/locales/en.yml +1 -1
- data/spec/logstash/agent_spec.rb +13 -0
- data/spec/logstash/util/wrapped_acked_queue_spec.rb +63 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e3a34fa89c2e677d893c0e08c30248cd0ab1afd
|
4
|
+
data.tar.gz: 1e9b3642bdecd73579f7612088bcc3c185835605
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab99a3bdcd46920b7da1b4c1a534ec39c38e86f6f46c6667604a43c42fcaf465f9c493bc616fa7db3fde3e971f794f7ccc8ba7ee60cc1696ea11cca379982d5c
|
7
|
+
data.tar.gz: ba03e641910ceeb050edbf3124243e9deb5acc6bc5c237289dc43b0a76f9712da7ad852b0572ebb1c75e67f43899baa300851104518b4cf71dba4937799c1fed
|
Binary file
|
data/lib/logstash/agent.rb
CHANGED
@@ -103,12 +103,12 @@ class LogStash::Agent
|
|
103
103
|
@pipelines[pipeline_id] = pipeline
|
104
104
|
end
|
105
105
|
|
106
|
-
def reload_state!
|
106
|
+
def reload_state!(force=false)
|
107
107
|
@upgrade_mutex.synchronize do
|
108
108
|
@pipelines.each do |pipeline_id, pipeline|
|
109
|
-
next if pipeline.settings.get("config.reload.automatic") == false
|
109
|
+
next if pipeline.settings.get("config.reload.automatic") == false && force == false
|
110
110
|
begin
|
111
|
-
reload_pipeline!(pipeline_id)
|
111
|
+
reload_pipeline!(pipeline_id, force)
|
112
112
|
rescue => e
|
113
113
|
@instance_reload_metric.increment(:failures)
|
114
114
|
@pipeline_reload_metric.namespace([pipeline_id.to_sym, :reloads]).tap do |n|
|
@@ -297,11 +297,11 @@ class LogStash::Agent
|
|
297
297
|
# reload_pipeline trys to reloads the pipeline with id using a potential new configuration if it changed
|
298
298
|
# since this method modifies the @pipelines hash it is wrapped in @upgrade_mutex in the parent call `reload_state!`
|
299
299
|
# @param id [String] the pipeline id to reload
|
300
|
-
def reload_pipeline!(id)
|
300
|
+
def reload_pipeline!(id, force=false)
|
301
301
|
old_pipeline = @pipelines[id]
|
302
302
|
new_config = fetch_config(old_pipeline.settings)
|
303
303
|
|
304
|
-
if old_pipeline.config_str == new_config
|
304
|
+
if old_pipeline.config_str == new_config && force == false
|
305
305
|
@logger.debug("no configuration change for pipeline", :pipeline => id)
|
306
306
|
return
|
307
307
|
end
|
@@ -17,7 +17,12 @@ class HotThreadsReport
|
|
17
17
|
report << '=' * STRING_SEPARATOR_LENGTH
|
18
18
|
report << "\n"
|
19
19
|
hash[:threads].each do |thread|
|
20
|
-
|
20
|
+
line_str = I18n.t("logstash.web_api.hot_threads.thread_title",
|
21
|
+
:percent_of_cpu_time => thread[:percent_of_cpu_time],
|
22
|
+
:thread_state => thread[:state],
|
23
|
+
:thread_name => thread[:name],
|
24
|
+
:thread_id => thread[:thread_id])
|
25
|
+
thread_report = "#{line_str} \n"
|
21
26
|
thread_report << "#{thread[:path]}\n" if thread[:path]
|
22
27
|
thread[:traces].each do |trace|
|
23
28
|
thread_report << "\t#{trace}\n"
|
@@ -31,9 +36,10 @@ class HotThreadsReport
|
|
31
36
|
|
32
37
|
def to_hash
|
33
38
|
hash = { :time => Time.now.iso8601, :busiest_threads => @thread_dump.top_count, :threads => [] }
|
34
|
-
@thread_dump.each do |
|
39
|
+
@thread_dump.each do |_hash|
|
35
40
|
thread_name, thread_path = _hash["thread.name"].split(": ")
|
36
41
|
thread = { :name => thread_name,
|
42
|
+
:thread_id => _hash["thread.id"],
|
37
43
|
:percent_of_cpu_time => cpu_time_as_percent(_hash),
|
38
44
|
:state => _hash["thread.state"]
|
39
45
|
}
|
data/lib/logstash/runner.rb
CHANGED
@@ -19,12 +19,13 @@ module LogStash
|
|
19
19
|
|
20
20
|
def each(&block)
|
21
21
|
i=0
|
22
|
-
dump.
|
22
|
+
dump.each do |hash|
|
23
|
+
thread_name = hash["thread.name"]
|
23
24
|
break if i >= top_count
|
24
25
|
if ignore
|
25
|
-
next if idle_thread?(thread_name,
|
26
|
+
next if idle_thread?(thread_name, hash)
|
26
27
|
end
|
27
|
-
block.call(
|
28
|
+
block.call(hash)
|
28
29
|
i += 1
|
29
30
|
end
|
30
31
|
end
|
@@ -100,6 +100,10 @@ module LogStash; module Util
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
+
def is_empty?
|
104
|
+
@queue.is_empty?
|
105
|
+
end
|
106
|
+
|
103
107
|
def close
|
104
108
|
@queue.close
|
105
109
|
@closed.make_true
|
@@ -129,7 +133,7 @@ module LogStash; module Util
|
|
129
133
|
def empty?
|
130
134
|
@mutex.lock
|
131
135
|
begin
|
132
|
-
@queue.
|
136
|
+
@queue.is_empty?
|
133
137
|
ensure
|
134
138
|
@mutex.unlock
|
135
139
|
end
|
data/lib/logstash/version.rb
CHANGED
data/locales/en.yml
CHANGED
@@ -79,7 +79,7 @@ en:
|
|
79
79
|
::: {%{hostname}}
|
80
80
|
Hot threads at %{time}, busiestThreads=%{top_count}:
|
81
81
|
thread_title: |-
|
82
|
-
%{percent_of_cpu_time} % of cpu usage, state: %{thread_state}, thread name: '%{thread_name}'
|
82
|
+
%{percent_of_cpu_time} % of cpu usage, state: %{thread_state}, thread name: '%{thread_name}', thread id: %{thread_id}
|
83
83
|
logging:
|
84
84
|
unrecognized_option: |-
|
85
85
|
unrecognized option [%{option}]
|
data/spec/logstash/agent_spec.rb
CHANGED
@@ -162,6 +162,19 @@ describe LogStash::Agent do
|
|
162
162
|
t.join
|
163
163
|
subject.shutdown
|
164
164
|
end
|
165
|
+
|
166
|
+
context "and force autoreload" do
|
167
|
+
it "reloads the pipeline" do
|
168
|
+
t = Thread.new { subject.execute }
|
169
|
+
sleep(0.01) until subject.running_pipelines? && subject.pipelines.values.first.running?
|
170
|
+
expect(subject).to receive(:reload_pipeline!).with("main", true)
|
171
|
+
subject.reload_state!(true)
|
172
|
+
|
173
|
+
Stud.stop!(t)
|
174
|
+
t.join
|
175
|
+
subject.shutdown
|
176
|
+
end
|
177
|
+
end
|
165
178
|
end
|
166
179
|
|
167
180
|
context "with a pipeline with auto reloading turned on" do
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
require "logstash/util/wrapped_acked_queue"
|
4
|
+
|
5
|
+
describe LogStash::Util::WrappedAckedQueue do
|
6
|
+
shared_examples "queue tests" do
|
7
|
+
it "is_empty? on creation" do
|
8
|
+
expect(queue.is_empty?).to be_truthy
|
9
|
+
end
|
10
|
+
|
11
|
+
it "not is_empty? after pushing an element" do
|
12
|
+
queue.push(LogStash::Event.new)
|
13
|
+
expect(queue.is_empty?).to be_falsey
|
14
|
+
end
|
15
|
+
|
16
|
+
it "not is_empty? when all elements are not acked" do
|
17
|
+
queue.push(LogStash::Event.new)
|
18
|
+
batch = queue.read_batch(1, 250)
|
19
|
+
expect(batch.get_elements.size).to eq(1)
|
20
|
+
expect(queue.is_empty?).to be_falsey
|
21
|
+
end
|
22
|
+
|
23
|
+
it "is_empty? when all elements are acked" do
|
24
|
+
queue.push(LogStash::Event.new)
|
25
|
+
batch = queue.read_batch(1, 250)
|
26
|
+
expect(batch.get_elements.size).to eq(1)
|
27
|
+
expect(queue.is_empty?).to be_falsey
|
28
|
+
batch.close
|
29
|
+
expect(queue.is_empty?).to be_truthy
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context "memory" do
|
34
|
+
let(:page_capacity) { 1024 }
|
35
|
+
let(:max_events) { 0 }
|
36
|
+
let(:max_bytes) { 0 }
|
37
|
+
let(:path) { Stud::Temporary.directory }
|
38
|
+
let(:queue) { LogStash::Util::WrappedAckedQueue.create_memory_based(path, page_capacity, max_events, max_bytes) }
|
39
|
+
|
40
|
+
after do
|
41
|
+
queue.close
|
42
|
+
end
|
43
|
+
|
44
|
+
include_examples "queue tests"
|
45
|
+
end
|
46
|
+
|
47
|
+
context "persisted" do
|
48
|
+
let(:page_capacity) { 1024 }
|
49
|
+
let(:max_events) { 0 }
|
50
|
+
let(:max_bytes) { 0 }
|
51
|
+
let(:checkpoint_acks) { 1024 }
|
52
|
+
let(:checkpoint_writes) { 1024 }
|
53
|
+
let(:checkpoint_interval) { 0 }
|
54
|
+
let(:path) { Stud::Temporary.directory }
|
55
|
+
let(:queue) { LogStash::Util::WrappedAckedQueue.create_file_based(path, page_capacity, max_events, checkpoint_acks, checkpoint_writes, checkpoint_interval, max_bytes) }
|
56
|
+
|
57
|
+
after do
|
58
|
+
queue.close
|
59
|
+
end
|
60
|
+
|
61
|
+
include_examples "queue tests"
|
62
|
+
end
|
63
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.5.
|
4
|
+
version: 5.5.2
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -551,6 +551,7 @@ files:
|
|
551
551
|
- spec/logstash/util/safe_uri_spec.rb
|
552
552
|
- spec/logstash/util/time_value_spec.rb
|
553
553
|
- spec/logstash/util/unicode_trimmer_spec.rb
|
554
|
+
- spec/logstash/util/wrapped_acked_queue_spec.rb
|
554
555
|
- spec/logstash/util/wrapped_synchronous_queue_spec.rb
|
555
556
|
- spec/logstash/util_spec.rb
|
556
557
|
- spec/logstash/webserver_spec.rb
|
@@ -575,9 +576,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
575
576
|
version: '0'
|
576
577
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
577
578
|
requirements:
|
578
|
-
- - "
|
579
|
+
- - ">="
|
579
580
|
- !ruby/object:Gem::Version
|
580
|
-
version:
|
581
|
+
version: '0'
|
581
582
|
requirements:
|
582
583
|
- jar org.apache.logging.log4j:log4j-api, 2.6.2
|
583
584
|
- jar org.apache.logging.log4j:log4j-core, 2.6.2
|
@@ -668,6 +669,7 @@ test_files:
|
|
668
669
|
- spec/logstash/util/safe_uri_spec.rb
|
669
670
|
- spec/logstash/util/time_value_spec.rb
|
670
671
|
- spec/logstash/util/unicode_trimmer_spec.rb
|
672
|
+
- spec/logstash/util/wrapped_acked_queue_spec.rb
|
671
673
|
- spec/logstash/util/wrapped_synchronous_queue_spec.rb
|
672
674
|
- spec/logstash/util_spec.rb
|
673
675
|
- spec/logstash/webserver_spec.rb
|