fluentd 1.16.8 → 1.16.10
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/.github/workflows/test.yml +24 -3
- data/CHANGELOG.md +32 -0
- data/README.md +0 -1
- data/SECURITY.md +6 -4
- data/lib/fluent/plugin_helper/server.rb +4 -1
- data/lib/fluent/test.rb +5 -2
- data/lib/fluent/version.rb +1 -1
- data/lib/fluent/winsvc.rb +1 -1
- data/test/plugin/test_in_object_space.rb +4 -0
- data/test/plugin/test_out_forward.rb +36 -34
- data/test/plugin_helper/test_server.rb +19 -0
- data/test/scripts/windows_service_test.ps1 +73 -0
- data/test/test_plugin_helper.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa40bacc9e6549ff2050843ead6a9852e6b3783a29c0e5f73dfbfad282707567
|
4
|
+
data.tar.gz: b429eb7f1a663524fb99bd89eb48de153ecdd1e85860048a26832be9143db964
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b437ed360b2bc3b65d965a88743b627a6c17efe0d5a328e57787b36c1b86b0749ee004cc84edba90c0a91a57dae98a7484ad5664f54c5fe37a589f36ebc7b02
|
7
|
+
data.tar.gz: 5711d692a6f2f4f5c9a9cfa7bfc8b6eafe4e588da708c5a09b5d9a386cd1d8c47a9ecb4ff5de6a77bcb8954dec5efa086234e14aeb9fee56abcd92ce91feee6c
|
data/.github/workflows/test.yml
CHANGED
@@ -16,6 +16,8 @@ concurrency:
|
|
16
16
|
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
|
17
17
|
cancel-in-progress: true
|
18
18
|
|
19
|
+
permissions: read-all
|
20
|
+
|
19
21
|
jobs:
|
20
22
|
test:
|
21
23
|
runs-on: ${{ matrix.os }}
|
@@ -25,10 +27,9 @@ jobs:
|
|
25
27
|
matrix:
|
26
28
|
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
|
27
29
|
ruby-version: ['3.3', '3.2', '3.1', '3.0', '2.7']
|
28
|
-
|
29
30
|
name: Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
30
31
|
steps:
|
31
|
-
- uses: actions/checkout@
|
32
|
+
- uses: actions/checkout@v5
|
32
33
|
- name: Set up Ruby
|
33
34
|
uses: ruby/setup-ruby@v1
|
34
35
|
with:
|
@@ -40,4 +41,24 @@ jobs:
|
|
40
41
|
- name: Install dependencies
|
41
42
|
run: bundle install
|
42
43
|
- name: Run tests
|
43
|
-
run: bundle exec rake test TESTOPTS="-v --no-show-detail-immediately"
|
44
|
+
run: bundle exec rake test TESTOPTS="-v --report-slow-tests --no-show-detail-immediately"
|
45
|
+
|
46
|
+
test-windows-service:
|
47
|
+
runs-on: windows-latest
|
48
|
+
strategy:
|
49
|
+
fail-fast: false
|
50
|
+
matrix:
|
51
|
+
ruby-version: ['3.3', '3.2', '3.1', '3.0', '2.7']
|
52
|
+
name: Windows service (Ruby ${{ matrix.ruby-version }})
|
53
|
+
steps:
|
54
|
+
- uses: actions/checkout@v5
|
55
|
+
- name: Set up Ruby
|
56
|
+
uses: ruby/setup-ruby@v1
|
57
|
+
with:
|
58
|
+
ruby-version: ${{ matrix.ruby-version }}
|
59
|
+
- name: Install dependencies
|
60
|
+
run: |
|
61
|
+
bundle install
|
62
|
+
rake install
|
63
|
+
- name: Run tests
|
64
|
+
run: test\scripts\windows_service_test.ps1
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,39 @@
|
|
1
1
|
# v1.16
|
2
2
|
|
3
|
+
## Release v1.16.10 - 2025/09/12
|
4
|
+
|
5
|
+
### Bug Fix
|
6
|
+
|
7
|
+
* server plugin helper: ensure to close all connections at shutdown
|
8
|
+
https://github.com/fluent/fluentd/pull/5088
|
9
|
+
|
10
|
+
### Misc
|
11
|
+
|
12
|
+
* CI improvemnts
|
13
|
+
https://github.com/fluent/fluentd/pull/5083
|
14
|
+
https://github.com/fluent/fluentd/pull/5085
|
15
|
+
https://github.com/fluent/fluentd/pull/5086
|
16
|
+
https://github.com/fluent/fluentd/pull/5091
|
17
|
+
https://github.com/fluent/fluentd/pull/5092
|
18
|
+
|
19
|
+
## Release v1.16.9 - 2025/05/14
|
20
|
+
|
21
|
+
### Bug Fix
|
22
|
+
|
23
|
+
* winsvc: Fix bug where service accidentally stops after starting.
|
24
|
+
The previous version (v1.16.8) should not be used for Windows Service.
|
25
|
+
https://github.com/fluent/fluentd/pull/4955
|
26
|
+
|
27
|
+
### Misc
|
28
|
+
|
29
|
+
* CI improvemnts
|
30
|
+
https://github.com/fluent/fluentd/pull/4956
|
31
|
+
|
3
32
|
## Release v1.16.8 - 2025/05/01
|
4
33
|
|
34
|
+
**This version has a critical bug about Windows Service. Do not use this version.**
|
35
|
+
(https://github.com/fluent/fluentd/pull/4955)
|
36
|
+
|
5
37
|
### Bug Fix
|
6
38
|
|
7
39
|
* winsvc: Stop the service when the supervisor is dead
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@ Fluentd: Open-Source Log Collector
|
|
4
4
|
[](https://github.com/fluent/fluentd/actions/workflows/linux-test.yaml)
|
5
5
|
[](https://github.com/fluent/fluentd/actions/workflows/windows-test.yaml)
|
6
6
|
[](https://github.com/fluent/fluentd/actions/workflows/macos-test.yaml)
|
7
|
-
[](https://codeclimate.com/github/fluent/fluentd)
|
8
7
|
[](https://bestpractices.coreinfrastructure.org/projects/1189)
|
9
8
|
|
10
9
|
[Fluentd](https://www.fluentd.org/) collects events from various data sources and writes them to files, RDBMS, NoSQL, IaaS, SaaS, Hadoop and so on. Fluentd helps you unify your logging infrastructure (Learn more about the [Unified Logging Layer](https://www.fluentd.org/blog/unified-logging-layer)).
|
data/SECURITY.md
CHANGED
@@ -2,11 +2,13 @@
|
|
2
2
|
|
3
3
|
## Supported Versions
|
4
4
|
|
5
|
-
|
|
6
|
-
|
5
|
+
| Version | Supported |
|
6
|
+
|-----------|--------------------|
|
7
|
+
| 1.19.x | :white_check_mark: |
|
8
|
+
| 1.18.x | :x: |
|
9
|
+
| 1.17.x | :x: |
|
7
10
|
| 1.16.x | :white_check_mark: |
|
8
|
-
| 1.15.x
|
9
|
-
| <= 1.14.x | :x: |
|
11
|
+
| <= 1.15.x | :x: |
|
10
12
|
|
11
13
|
## Reporting a Vulnerability
|
12
14
|
|
@@ -347,7 +347,10 @@ module Fluent
|
|
347
347
|
end
|
348
348
|
|
349
349
|
def shutdown
|
350
|
-
@_server_connections
|
350
|
+
# When it invokes conn.cose, it reduces elements in @_server_connections by close_callback,
|
351
|
+
# and it reduces the number of loops. This prevents the connection closing.
|
352
|
+
# So, it requires invoking #dup to avoid the problem.
|
353
|
+
@_server_connections.dup.each do |conn|
|
351
354
|
conn.close rescue nil
|
352
355
|
end
|
353
356
|
|
data/lib/fluent/test.rb
CHANGED
@@ -40,9 +40,12 @@ module Fluent
|
|
40
40
|
|
41
41
|
$log = dummy_logger
|
42
42
|
|
43
|
-
Fluent.__send__(:remove_const, :Engine)
|
44
|
-
|
43
|
+
old_engine = Fluent.__send__(:remove_const, :Engine)
|
44
|
+
# Ensure that GC can remove the objects of the old engine.
|
45
|
+
# Some objects can still exist after `remove_const`. See https://github.com/fluent/fluentd/issues/5054.
|
46
|
+
old_engine.instance_variable_set(:@root_agent, nil)
|
45
47
|
|
48
|
+
engine = Fluent.const_set(:Engine, EngineClass.new).init(SystemConfig.new)
|
46
49
|
engine.define_singleton_method(:now=) {|n|
|
47
50
|
@now = n
|
48
51
|
}
|
data/lib/fluent/version.rb
CHANGED
data/lib/fluent/winsvc.rb
CHANGED
@@ -50,6 +50,10 @@ class ObjectSpaceInputTest < Test::Unit::TestCase
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_emit
|
53
|
+
# Force release garbaged objects due to avoid unexpected error by mock objects on `on_timer`
|
54
|
+
# https://github.com/fluent/fluentd/pull/5055
|
55
|
+
GC.start
|
56
|
+
|
53
57
|
d = create_driver
|
54
58
|
|
55
59
|
d.run(expect_emits: 3)
|
@@ -178,6 +178,42 @@ EOL
|
|
178
178
|
assert{ logs.any?{|log| log.include?(expected_log) && log.include?(expected_detail) } }
|
179
179
|
end
|
180
180
|
|
181
|
+
sub_test_case 'configure compress' do
|
182
|
+
data('default', ['', :text])
|
183
|
+
data('gzip', ['compress gzip', :gzip])
|
184
|
+
test 'should be applied' do |(option, expected)|
|
185
|
+
@d = d = create_driver(config + option)
|
186
|
+
node = d.instance.nodes.first
|
187
|
+
|
188
|
+
assert_equal(
|
189
|
+
[expected, expected],
|
190
|
+
[d.instance.compress, node.instance_variable_get(:@compress)]
|
191
|
+
)
|
192
|
+
end
|
193
|
+
|
194
|
+
# TODO add tests that we cannot configure the different compress type between owner and buffer except for :text
|
195
|
+
data('gzip', ['compress gzip', :text, :gzip])
|
196
|
+
test 'can configure buffer compress separately when owner uses :text' do |(buffer_option, expected_owner_compress, expected_buffer_compress)|
|
197
|
+
@d = d = create_driver(config + %[
|
198
|
+
<buffer>
|
199
|
+
type memory
|
200
|
+
#{buffer_option}
|
201
|
+
</buffer>
|
202
|
+
])
|
203
|
+
node = d.instance.nodes.first
|
204
|
+
|
205
|
+
assert_equal(
|
206
|
+
[expected_owner_compress, expected_owner_compress, expected_buffer_compress],
|
207
|
+
[d.instance.compress, node.instance_variable_get(:@compress), d.instance.buffer.compress],
|
208
|
+
)
|
209
|
+
|
210
|
+
log_message = "buffer is compressed. If you also want to save the bandwidth of a network, Add `compress` configuration in <match>"
|
211
|
+
assert do
|
212
|
+
d.logs.any? { |log| log.include?(log_message) }
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
181
217
|
data('CA cert' => 'tls_ca_cert_path',
|
182
218
|
'non CA cert' => 'tls_cert_path')
|
183
219
|
test 'configure tls_cert_path/tls_ca_cert_path' do |param|
|
@@ -326,40 +362,6 @@ EOL
|
|
326
362
|
assert_equal 1234, d.instance.discovery_manager.services[0].port
|
327
363
|
end
|
328
364
|
|
329
|
-
test 'compress_default_value' do
|
330
|
-
@d = d = create_driver
|
331
|
-
assert_equal :text, d.instance.compress
|
332
|
-
|
333
|
-
node = d.instance.nodes.first
|
334
|
-
assert_equal :text, node.instance_variable_get(:@compress)
|
335
|
-
end
|
336
|
-
|
337
|
-
test 'set_compress_is_gzip' do
|
338
|
-
@d = d = create_driver(config + %[compress gzip])
|
339
|
-
assert_equal :gzip, d.instance.compress
|
340
|
-
assert_equal :gzip, d.instance.buffer.compress
|
341
|
-
|
342
|
-
node = d.instance.nodes.first
|
343
|
-
assert_equal :gzip, node.instance_variable_get(:@compress)
|
344
|
-
end
|
345
|
-
|
346
|
-
test 'set_compress_is_gzip_in_buffer_section' do
|
347
|
-
mock = flexmock($log)
|
348
|
-
mock.should_receive(:log).with("buffer is compressed. If you also want to save the bandwidth of a network, Add `compress` configuration in <match>")
|
349
|
-
|
350
|
-
@d = d = create_driver(config + %[
|
351
|
-
<buffer>
|
352
|
-
type memory
|
353
|
-
compress gzip
|
354
|
-
</buffer>
|
355
|
-
])
|
356
|
-
assert_equal :text, d.instance.compress
|
357
|
-
assert_equal :gzip, d.instance.buffer.compress
|
358
|
-
|
359
|
-
node = d.instance.nodes.first
|
360
|
-
assert_equal :text, node.instance_variable_get(:@compress)
|
361
|
-
end
|
362
|
-
|
363
365
|
test 'phi_failure_detector disabled' do
|
364
366
|
@d = d = create_driver(config + %[phi_failure_detector false \n phi_threshold 0])
|
365
367
|
node = d.instance.nodes.first
|
@@ -364,6 +364,25 @@ class ServerPluginHelperTest < Test::Unit::TestCase
|
|
364
364
|
d2.stop; d2.before_shutdown; d2.shutdown; d2.after_shutdown; d2.close; d2.terminate
|
365
365
|
end
|
366
366
|
end
|
367
|
+
|
368
|
+
test 'close all connections by shutdown' do
|
369
|
+
@d.server_create_tcp(:s, @port) do |data, conn|
|
370
|
+
end
|
371
|
+
|
372
|
+
client_sockets = []
|
373
|
+
5.times do
|
374
|
+
client_sockets << TCPSocket.open("127.0.0.1", @port)
|
375
|
+
end
|
376
|
+
waiting(4){ sleep 0.1 until @d.instance_variable_get(:@_server_connections).size == 5 }
|
377
|
+
|
378
|
+
@d.stop
|
379
|
+
@d.before_shutdown
|
380
|
+
@d.shutdown
|
381
|
+
|
382
|
+
assert_true @d.instance_variable_get(:@_server_connections).empty?
|
383
|
+
ensure
|
384
|
+
client_sockets.each(&:close)
|
385
|
+
end
|
367
386
|
end
|
368
387
|
|
369
388
|
sub_test_case '#server_create' do
|
@@ -0,0 +1,73 @@
|
|
1
|
+
$ErrorActionPreference = "Stop"
|
2
|
+
Set-PSDebug -Trace 1
|
3
|
+
|
4
|
+
$default_conf_path = (Resolve-Path fluent.conf).Path
|
5
|
+
$current_path = (Get-Location).Path
|
6
|
+
$log_path = "$current_path/fluentd.log"
|
7
|
+
|
8
|
+
ruby bin/fluentd --reg-winsvc i --reg-winsvc-fluentdopt "-c '$default_conf_path' -o '$log_path'"
|
9
|
+
|
10
|
+
# Test: must not start automatically
|
11
|
+
if ((Get-Service fluentdwinsvc).Status -ne "Stopped") {
|
12
|
+
Write-Error "The service should not start automatically."
|
13
|
+
}
|
14
|
+
|
15
|
+
Start-Service fluentdwinsvc
|
16
|
+
Start-Sleep 30
|
17
|
+
|
18
|
+
# Test: the service should be running after started
|
19
|
+
if ((Get-Service fluentdwinsvc).Status -ne "Running") {
|
20
|
+
Write-Error "The service should be running after started."
|
21
|
+
}
|
22
|
+
|
23
|
+
# Test: no warn/error/fatal logs
|
24
|
+
Get-ChildItem "*.log" | %{
|
25
|
+
Get-Content $_
|
26
|
+
if (Select-String -Path $_ -Pattern "[warn]", "[error]", "[fatal]" -SimpleMatch -Quiet) {
|
27
|
+
Select-String -Path $_ -Pattern "[warn]", "[error]", "[fatal]" -SimpleMatch
|
28
|
+
Write-Error "There are abnormal level logs in ${_}:"
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
Stop-Service fluentdwinsvc
|
33
|
+
Start-Sleep 10 # Somehow it is possible that some processes stay alive for a while. (This could be not good behavior...)
|
34
|
+
|
35
|
+
# Test: status after stopped
|
36
|
+
if ((Get-Service fluentdwinsvc).Status -ne "Stopped") {
|
37
|
+
Write-Error "The service should be in 'Stopped' status after stopped."
|
38
|
+
}
|
39
|
+
# Test: all Ruby processes should stop
|
40
|
+
$ruby_processes = Get-Process -name ruby -ErrorAction SilentlyContinue
|
41
|
+
if ($ruby_processes.Count -ne 0) {
|
42
|
+
Write-Output $ruby_processes
|
43
|
+
Write-Error "All Ruby processes should stop."
|
44
|
+
}
|
45
|
+
|
46
|
+
# Test: service should stop when the supervisor fails to launch
|
47
|
+
# https://github.com/fluent/fluentd/pull/4909
|
48
|
+
$test_setting = @'
|
49
|
+
<source>
|
50
|
+
@type sample
|
51
|
+
@id DUPLICATED_ID
|
52
|
+
tag test
|
53
|
+
</source>
|
54
|
+
<match test>
|
55
|
+
@type stdout
|
56
|
+
@id DUPLICATED_ID
|
57
|
+
</match>
|
58
|
+
'@
|
59
|
+
Add-Content -Path "duplicated_id.conf" -Encoding UTF8 -Value $test_setting
|
60
|
+
ruby bin/fluentd --reg-winsvc-fluentdopt "-c '$current_path/duplicated_id.conf' -o '$log_path'"
|
61
|
+
Start-Service fluentdwinsvc
|
62
|
+
Start-Sleep 30
|
63
|
+
if ((Get-Service fluentdwinsvc).Status -ne "Stopped") {
|
64
|
+
Write-Error "The service should be in 'Stopped' status when the supervisor fails to launch."
|
65
|
+
}
|
66
|
+
$ruby_processes = Get-Process -name ruby -ErrorAction SilentlyContinue
|
67
|
+
if ($ruby_processes.Count -ne 0) {
|
68
|
+
Write-Output $ruby_processes
|
69
|
+
Write-Error "All Ruby processes should stop."
|
70
|
+
}
|
71
|
+
|
72
|
+
ruby bin/fluentd --reg-winsvc u
|
73
|
+
Remove-Item $log_path
|
data/test/test_plugin_helper.rb
CHANGED
@@ -2,7 +2,7 @@ require_relative 'helper'
|
|
2
2
|
require 'fluent/plugin_helper'
|
3
3
|
require 'fluent/plugin/base'
|
4
4
|
|
5
|
-
class
|
5
|
+
class PluginHelperTest < Test::Unit::TestCase
|
6
6
|
module FluentTest; end
|
7
7
|
|
8
8
|
sub_test_case 'Fluent::Plugin::Base.helpers method works as shortcut to include helper modules' do
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluentd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.16.
|
4
|
+
version: 1.16.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: bundler
|
@@ -931,6 +930,7 @@ files:
|
|
931
930
|
- test/scripts/fluent/plugin/out_test.rb
|
932
931
|
- test/scripts/fluent/plugin/out_test2.rb
|
933
932
|
- test/scripts/fluent/plugin/parser_known.rb
|
933
|
+
- test/scripts/windows_service_test.ps1
|
934
934
|
- test/test_capability.rb
|
935
935
|
- test/test_clock.rb
|
936
936
|
- test/test_config.rb
|
@@ -969,7 +969,6 @@ homepage: https://www.fluentd.org/
|
|
969
969
|
licenses:
|
970
970
|
- Apache-2.0
|
971
971
|
metadata: {}
|
972
|
-
post_install_message:
|
973
972
|
rdoc_options: []
|
974
973
|
require_paths:
|
975
974
|
- lib
|
@@ -984,8 +983,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
984
983
|
- !ruby/object:Gem::Version
|
985
984
|
version: '0'
|
986
985
|
requirements: []
|
987
|
-
rubygems_version: 3.
|
988
|
-
signing_key:
|
986
|
+
rubygems_version: 3.6.8
|
989
987
|
specification_version: 4
|
990
988
|
summary: Fluentd event collector
|
991
989
|
test_files:
|
@@ -1174,6 +1172,7 @@ test_files:
|
|
1174
1172
|
- test/scripts/fluent/plugin/out_test.rb
|
1175
1173
|
- test/scripts/fluent/plugin/out_test2.rb
|
1176
1174
|
- test/scripts/fluent/plugin/parser_known.rb
|
1175
|
+
- test/scripts/windows_service_test.ps1
|
1177
1176
|
- test/test_capability.rb
|
1178
1177
|
- test/test_clock.rb
|
1179
1178
|
- test/test_config.rb
|