fluentd 1.12.2-x64-mingw32 → 1.12.3-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fluentd might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/workflows/windows-test.yaml +7 -2
- data/.gitlab-ci.yml +41 -19
- data/CHANGELOG.md +42 -0
- data/README.md +5 -2
- data/fluentd.gemspec +3 -2
- data/lib/fluent/command/plugin_generator.rb +31 -1
- data/lib/fluent/plugin/file_wrapper.rb +39 -3
- data/lib/fluent/plugin/in_tail.rb +2 -1
- data/lib/fluent/plugin/output.rb +11 -9
- data/lib/fluent/plugin/parser_csv.rb +2 -2
- data/lib/fluent/plugin/parser_syslog.rb +2 -2
- data/lib/fluent/plugin/storage_local.rb +1 -1
- data/lib/fluent/plugin_helper/server.rb +4 -2
- data/lib/fluent/plugin_helper/socket_option.rb +2 -2
- data/lib/fluent/version.rb +1 -1
- data/templates/new_gem/fluent-plugin.gemspec.erb +3 -3
- data/test/plugin/out_forward/test_connection_manager.rb +0 -6
- data/test/plugin/test_file_wrapper.rb +105 -0
- data/test/plugin/test_in_tail.rb +33 -10
- data/test/plugin/test_out_forward.rb +26 -12
- data/test/plugin/test_output.rb +15 -3
- data/test/plugin/test_output_as_buffered_backup.rb +2 -0
- data/test/plugin/test_parser_csv.rb +14 -0
- data/test/plugin/test_parser_syslog.rb +14 -0
- data/test/plugin_helper/service_discovery/test_manager.rb +1 -1
- data/test/plugin_helper/test_http_server_helper.rb +1 -1
- data/test/plugin_helper/test_server.rb +8 -2
- data/test/test_output.rb +2 -2
- metadata +29 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a95544b9d91309608d82ca124db9f320e7d03f5b807c46a0d921aa5d4052fd2d
|
4
|
+
data.tar.gz: 6d80a00cda2a7cfaab06abb73e33de77bc6fb6aded7c169a08331e1ac43a626c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4573c3999a649f235e09ab00cb2065aa59b4e5f975ff7b4914082fd57b3f1f1941a025d31d4e52436da1d1fa685d2ee95b68a8b59b642e368bbc9cd6b488335d
|
7
|
+
data.tar.gz: a3d8a9f0aea51fc1bdd95924631908448464d6f2da6871d39338cd790f4ad1d05e7214da26f43bdcc101ae469025a1c74375ae2a34db7d8642f6b17d3f7cd592
|
@@ -9,13 +9,18 @@ on:
|
|
9
9
|
jobs:
|
10
10
|
test:
|
11
11
|
runs-on: ${{ matrix.os }}
|
12
|
-
|
12
|
+
continue-on-error: ${{ matrix.experimental }}
|
13
13
|
strategy:
|
14
14
|
fail-fast: false
|
15
15
|
matrix:
|
16
|
-
ruby-version: ['
|
16
|
+
ruby-version: ['2.7', '2.6', '2.5']
|
17
17
|
os:
|
18
18
|
- windows-latest
|
19
|
+
experimental: [false]
|
20
|
+
include:
|
21
|
+
- ruby-version: '3.0'
|
22
|
+
os: windows-latest
|
23
|
+
experimental: true
|
19
24
|
|
20
25
|
name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
21
26
|
steps:
|
data/.gitlab-ci.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
.install-template:
|
2
2
|
before_script:
|
3
|
-
- gem update --system
|
3
|
+
- gem update --system
|
4
4
|
- ruby -v
|
5
5
|
|
6
6
|
.test-template:
|
@@ -13,34 +13,44 @@ stages:
|
|
13
13
|
- build
|
14
14
|
- tests
|
15
15
|
|
16
|
-
2-
|
17
|
-
image: "ruby:2.
|
16
|
+
2-5-8:
|
17
|
+
image: "ruby:2.5.8"
|
18
18
|
stage: build
|
19
19
|
extends: .install-template
|
20
20
|
script:
|
21
21
|
- bundle install --jobs=3 --retry=3
|
22
22
|
cache:
|
23
|
-
key: "$CI_COMMIT_REF_SLUG 2-
|
23
|
+
key: "$CI_COMMIT_REF_SLUG 2-5-8"
|
24
24
|
paths:
|
25
25
|
|
26
|
-
2-
|
27
|
-
image: "ruby:2.
|
26
|
+
2-6-6:
|
27
|
+
image: "ruby:2.6.6"
|
28
28
|
stage: build
|
29
29
|
extends: .install-template
|
30
30
|
script:
|
31
31
|
- bundle install --jobs=3 --retry=3
|
32
32
|
cache:
|
33
|
-
key: "$CI_COMMIT_REF_SLUG 2-
|
33
|
+
key: "$CI_COMMIT_REF_SLUG 2-6-6"
|
34
34
|
paths:
|
35
35
|
|
36
|
-
2-
|
37
|
-
image: "ruby:2.
|
36
|
+
2-7-2:
|
37
|
+
image: "ruby:2.7.2"
|
38
38
|
stage: build
|
39
39
|
extends: .install-template
|
40
40
|
script:
|
41
41
|
- bundle install --jobs=3 --retry=3
|
42
42
|
cache:
|
43
|
-
key: "$CI_COMMIT_REF_SLUG 2-
|
43
|
+
key: "$CI_COMMIT_REF_SLUG 2-7-2"
|
44
|
+
paths:
|
45
|
+
|
46
|
+
3-0-0:
|
47
|
+
image: "ruby:3.0.0"
|
48
|
+
stage: build
|
49
|
+
extends: .install-template
|
50
|
+
script:
|
51
|
+
- bundle install --jobs=3 --retry=3
|
52
|
+
cache:
|
53
|
+
key: "$CI_COMMIT_REF_SLUG 3-0-0"
|
44
54
|
paths:
|
45
55
|
|
46
56
|
rubyhead:
|
@@ -54,39 +64,51 @@ rubyhead:
|
|
54
64
|
paths:
|
55
65
|
- ./*
|
56
66
|
|
57
|
-
2-
|
58
|
-
image: "ruby:2.
|
67
|
+
2-5-8-test:
|
68
|
+
image: "ruby:2.5.8"
|
69
|
+
stage: tests
|
70
|
+
allow_failure: true
|
71
|
+
extends: .test-template
|
72
|
+
script:
|
73
|
+
- bundle exec rake test
|
74
|
+
cache:
|
75
|
+
key: "$CI_COMMIT_REF_SLUG 2-5-8"
|
76
|
+
paths:
|
77
|
+
- ./*
|
78
|
+
|
79
|
+
2-6-6-test:
|
80
|
+
image: "ruby:2.6.6"
|
59
81
|
stage: tests
|
60
82
|
allow_failure: true
|
61
83
|
extends: .test-template
|
62
84
|
script:
|
63
85
|
- bundle exec rake test
|
64
86
|
cache:
|
65
|
-
key: "$CI_COMMIT_REF_SLUG 2-
|
87
|
+
key: "$CI_COMMIT_REF_SLUG 2-6-6"
|
66
88
|
paths:
|
67
89
|
- ./*
|
68
90
|
|
69
|
-
2-
|
70
|
-
image: "ruby:2.
|
91
|
+
2-7-2-test:
|
92
|
+
image: "ruby:2.7.2"
|
71
93
|
stage: tests
|
72
94
|
allow_failure: true
|
73
95
|
extends: .test-template
|
74
96
|
script:
|
75
97
|
- bundle exec rake test
|
76
98
|
cache:
|
77
|
-
key: "$CI_COMMIT_REF_SLUG 2-
|
99
|
+
key: "$CI_COMMIT_REF_SLUG 2-7-2"
|
78
100
|
paths:
|
79
101
|
- ./*
|
80
102
|
|
81
|
-
|
82
|
-
image: "ruby:
|
103
|
+
3-0-0-test:
|
104
|
+
image: "ruby:3.0.0"
|
83
105
|
stage: tests
|
84
106
|
allow_failure: true
|
85
107
|
extends: .test-template
|
86
108
|
script:
|
87
109
|
- bundle exec rake test
|
88
110
|
cache:
|
89
|
-
key: "$CI_COMMIT_REF_SLUG
|
111
|
+
key: "$CI_COMMIT_REF_SLUG 3-0-0"
|
90
112
|
paths:
|
91
113
|
- ./*
|
92
114
|
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,47 @@
|
|
1
1
|
# v1.12
|
2
2
|
|
3
|
+
## Release v1.12.3 - 2021/04/23
|
4
|
+
|
5
|
+
### Enhancement
|
6
|
+
|
7
|
+
* plugin_helper: Allow TLS to use keep-alive socket option
|
8
|
+
https://github.com/fluent/fluentd/pull/3308
|
9
|
+
|
10
|
+
### Bug fix
|
11
|
+
|
12
|
+
* parser_csv, parser_syslog: Fix a naming conflict on parser_type
|
13
|
+
https://github.com/fluent/fluentd/pull/3302
|
14
|
+
* in_tail: Fix incorrect error code & message on Windows
|
15
|
+
https://github.com/fluent/fluentd/pull/3325
|
16
|
+
https://github.com/fluent/fluentd/pull/3329
|
17
|
+
https://github.com/fluent/fluentd/pull/3331
|
18
|
+
https://github.com/fluent/fluentd/pull/3337
|
19
|
+
* in_tail: Fix a crash bug on catching a short-lived log
|
20
|
+
https://github.com/fluent/fluentd/pull/3328
|
21
|
+
* storage_local: Fix position file corruption issue on concurrent gracefulReloads
|
22
|
+
https://github.com/fluent/fluentd/pull/3335
|
23
|
+
* Fix incorrect warnings about ${chunk_id} with out_s3
|
24
|
+
https://github.com/fluent/fluentd/pull/3339
|
25
|
+
* TLS Server: Add peer information to error log message
|
26
|
+
https://github.com/fluent/fluentd/pull/3330
|
27
|
+
|
28
|
+
### Misc
|
29
|
+
|
30
|
+
* fluent-plugin-generate: add note about plugin name
|
31
|
+
https://github.com/fluent/fluentd/pull/3303
|
32
|
+
* fluent-plugin-generate: Use same depended gem version with fluentd
|
33
|
+
https://github.com/fluent/fluentd/pull/3305
|
34
|
+
* Fix some broken unit tests and improve CI's stability
|
35
|
+
https://github.com/fluent/fluentd/pull/3304
|
36
|
+
https://github.com/fluent/fluentd/pull/3307
|
37
|
+
https://github.com/fluent/fluentd/pull/3312
|
38
|
+
https://github.com/fluent/fluentd/pull/3313
|
39
|
+
https://github.com/fluent/fluentd/pull/3314
|
40
|
+
https://github.com/fluent/fluentd/pull/3316
|
41
|
+
https://github.com/fluent/fluentd/pull/3336
|
42
|
+
* Permit to install with win32-service 2.2.0 on Windows
|
43
|
+
https://github.com/fluent/fluentd/pull/3343
|
44
|
+
|
3
45
|
## Release v1.12.2 - 2021/03/29
|
4
46
|
|
5
47
|
### Enhancement
|
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
Fluentd: Open-Source Log Collector
|
2
2
|
===================================
|
3
|
-
|
3
|
+
GitHub Actions:
|
4
4
|
|
5
|
-
[
|
5
|
+
[![Testing on Ubuntu](https://github.com/fluent/fluentd/actions/workflows/linux-test.yaml/badge.svg?branch=master)](https://github.com/fluent/fluentd/actions/workflows/linux-test.yaml)
|
6
|
+
[![Testing on Windows](https://github.com/fluent/fluentd/actions/workflows/windows-test.yaml/badge.svg?branch=master)](https://github.com/fluent/fluentd/actions/workflows/windows-test.yaml)
|
7
|
+
[![Testing on macOS](https://github.com/fluent/fluentd/actions/workflows/macos-test.yaml/badge.svg?branch=master)](https://github.com/fluent/fluentd/actions/workflows/macos-test.yaml)
|
8
|
+
[![Code Climate](https://codeclimate.com/github/fluent/fluentd/badges/gpa.svg)](https://codeclimate.com/github/fluent/fluentd)
|
6
9
|
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1189/badge)](https://bestpractices.coreinfrastructure.org/projects/1189)
|
7
10
|
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Ffluent%2Ffluentd.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Ffluent%2Ffluentd?ref=badge_shield)
|
8
11
|
|
data/fluentd.gemspec
CHANGED
@@ -34,7 +34,8 @@ Gem::Specification.new do |gem|
|
|
34
34
|
fake_platform = ENV['GEM_BUILD_FAKE_PLATFORM'].to_s
|
35
35
|
gem.platform = fake_platform unless fake_platform.empty?
|
36
36
|
if /mswin|mingw/ =~ fake_platform || (/mswin|mingw/ =~ RUBY_PLATFORM && fake_platform.empty?)
|
37
|
-
gem.add_runtime_dependency("win32-
|
37
|
+
gem.add_runtime_dependency("win32-api", [">= 1.10", "< 2.0.0"])
|
38
|
+
gem.add_runtime_dependency("win32-service", ["~> 2.2.0"])
|
38
39
|
gem.add_runtime_dependency("win32-ipc", ["~> 0.7.0"])
|
39
40
|
gem.add_runtime_dependency("win32-event", ["~> 0.6.3"])
|
40
41
|
gem.add_runtime_dependency("windows-pr", ["~> 1.2.6"])
|
@@ -45,7 +46,7 @@ Gem::Specification.new do |gem|
|
|
45
46
|
gem.add_development_dependency("flexmock", ["~> 2.0"])
|
46
47
|
gem.add_development_dependency("parallel_tests", ["~> 0.15.3"])
|
47
48
|
gem.add_development_dependency("simplecov", ["~> 0.7"])
|
48
|
-
gem.add_development_dependency("rr", ["~>
|
49
|
+
gem.add_development_dependency("rr", ["~> 3.0"])
|
49
50
|
gem.add_development_dependency("timecop", ["~> 0.9"])
|
50
51
|
gem.add_development_dependency("test-unit", ["~> 3.3"])
|
51
52
|
gem.add_development_dependency("test-unit-rr", ["~> 1.0"])
|
@@ -105,7 +105,7 @@ Generate a project skeleton for creating a Fluentd plugin
|
|
105
105
|
|
106
106
|
Arguments:
|
107
107
|
\ttype: #{SUPPORTED_TYPES.join(",")}
|
108
|
-
\tname: Your plugin name
|
108
|
+
\tname: Your plugin name (fluent-plugin- prefix will be added to <name>)
|
109
109
|
|
110
110
|
Options:
|
111
111
|
BANNER
|
@@ -151,6 +151,36 @@ BANNER
|
|
151
151
|
underscore_name
|
152
152
|
end
|
153
153
|
|
154
|
+
def gem_file_path
|
155
|
+
File.expand_path(File.join(File.dirname(__FILE__),
|
156
|
+
"../../../",
|
157
|
+
"Gemfile"))
|
158
|
+
end
|
159
|
+
|
160
|
+
def lock_file_path
|
161
|
+
File.expand_path(File.join(File.dirname(__FILE__),
|
162
|
+
"../../../",
|
163
|
+
"Gemfile.lock"))
|
164
|
+
end
|
165
|
+
|
166
|
+
def locked_gem_version(gem_name)
|
167
|
+
d = Bundler::Definition.build(gem_file_path, lock_file_path, false)
|
168
|
+
d.locked_gems.dependencies[gem_name].requirement.requirements.first.last.version
|
169
|
+
end
|
170
|
+
|
171
|
+
def rake_version
|
172
|
+
locked_gem_version("rake")
|
173
|
+
end
|
174
|
+
|
175
|
+
def test_unit_version
|
176
|
+
locked_gem_version("test-unit")
|
177
|
+
end
|
178
|
+
|
179
|
+
def bundler_version
|
180
|
+
d = Bundler::Definition.build(gem_file_path, lock_file_path, false)
|
181
|
+
d.locked_gems.bundler_version.version
|
182
|
+
end
|
183
|
+
|
154
184
|
def class_name
|
155
185
|
"#{capitalized_name}#{type.capitalize}"
|
156
186
|
end
|
@@ -46,6 +46,42 @@ module Fluent
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
class Win32Error < StandardError
|
50
|
+
require 'windows/error'
|
51
|
+
include Windows::Error
|
52
|
+
|
53
|
+
attr_reader :errcode, :msg
|
54
|
+
|
55
|
+
def initialize(errcode, msg = nil)
|
56
|
+
@errcode = errcode
|
57
|
+
@msg = msg
|
58
|
+
end
|
59
|
+
|
60
|
+
def format_english_message(errcode)
|
61
|
+
buf = 0.chr * 260
|
62
|
+
flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY
|
63
|
+
english_lang_id = 1033 # The result of MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)
|
64
|
+
FormatMessageA.call(flags, 0, errcode, english_lang_id, buf, buf.size, 0)
|
65
|
+
buf.force_encoding(Encoding.default_external).strip
|
66
|
+
end
|
67
|
+
|
68
|
+
def to_s
|
69
|
+
msg = super
|
70
|
+
msg << ": code: #{@errcode}, #{format_english_message(@errcode)}"
|
71
|
+
msg << " - #{@msg}" if @msg
|
72
|
+
msg
|
73
|
+
end
|
74
|
+
|
75
|
+
def inspect
|
76
|
+
"#<#{to_s}>"
|
77
|
+
end
|
78
|
+
|
79
|
+
def ==(other)
|
80
|
+
return false if other.class != Win32Error
|
81
|
+
@errcode == other.errcode && @msg == other.msg
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
49
85
|
# To open and get stat with setting FILE_SHARE_DELETE
|
50
86
|
class WindowsFile
|
51
87
|
require 'windows/file'
|
@@ -77,11 +113,11 @@ module Fluent
|
|
77
113
|
@file_handle = CreateFile.call(@path, access, sharemode,
|
78
114
|
0, creationdisposition, FILE_ATTRIBUTE_NORMAL, 0)
|
79
115
|
if @file_handle == INVALID_HANDLE_VALUE
|
80
|
-
err =
|
116
|
+
err = Win32::API.last_error
|
81
117
|
if err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND || err == ERROR_ACCESS_DENIED
|
82
|
-
raise
|
118
|
+
raise Errno::ENOENT
|
83
119
|
end
|
84
|
-
raise
|
120
|
+
raise Win32Error.new(err, path)
|
85
121
|
end
|
86
122
|
end
|
87
123
|
|
@@ -419,7 +419,8 @@ module Fluent::Plugin
|
|
419
419
|
rescue Errno::ENOENT
|
420
420
|
$log.warn "stat() for #{target_info.path} failed with ENOENT. Drop tail watcher for now."
|
421
421
|
# explicitly detach and unwatch watcher `tw`.
|
422
|
-
|
422
|
+
tw.unwatched = true
|
423
|
+
detach_watcher(tw, target_info.ino, false)
|
423
424
|
end
|
424
425
|
}
|
425
426
|
end
|
data/lib/fluent/plugin/output.rb
CHANGED
@@ -754,7 +754,17 @@ module Fluent
|
|
754
754
|
log.warn "tag placeholder '#{$1}' not replaced. tag:#{metadata.tag}, template:#{str}"
|
755
755
|
end
|
756
756
|
end
|
757
|
-
|
757
|
+
|
758
|
+
# First we replace ${chunk_id} with chunk.unique_id (hexlified).
|
759
|
+
rvalue = rvalue.sub(CHUNK_ID_PLACEHOLDER_PATTERN) {
|
760
|
+
if chunk_passed
|
761
|
+
dump_unique_id_hex(chunk.unique_id)
|
762
|
+
else
|
763
|
+
log.warn "${chunk_id} is not allowed in this plugin. Pass Chunk instead of metadata in extract_placeholders's 2nd argument"
|
764
|
+
end
|
765
|
+
}
|
766
|
+
|
767
|
+
# Then, replace other ${chunk_key}s.
|
758
768
|
if !@chunk_keys.empty? && metadata.variables
|
759
769
|
hash = {'${tag}' => '${tag}'} # not to erase this wrongly
|
760
770
|
@chunk_keys.each do |key|
|
@@ -769,14 +779,6 @@ module Fluent
|
|
769
779
|
end
|
770
780
|
end
|
771
781
|
|
772
|
-
rvalue = rvalue.sub(CHUNK_ID_PLACEHOLDER_PATTERN) {
|
773
|
-
if chunk_passed
|
774
|
-
dump_unique_id_hex(chunk.unique_id)
|
775
|
-
else
|
776
|
-
log.warn "${chunk_id} is not allowed in this plugin. Pass Chunk instead of metadata in extract_placeholders's 2nd argument"
|
777
|
-
end
|
778
|
-
}
|
779
|
-
|
780
782
|
if rvalue =~ CHUNK_KEY_PLACEHOLDER_PATTERN
|
781
783
|
log.warn "chunk key placeholder '#{$1}' not replaced. template:#{str}"
|
782
784
|
end
|
@@ -28,13 +28,13 @@ module Fluent
|
|
28
28
|
desc 'The delimiter character (or string) of CSV values'
|
29
29
|
config_param :delimiter, :string, default: ','
|
30
30
|
desc 'The parser type used to parse CSV line'
|
31
|
-
config_param :
|
31
|
+
config_param :parser_engine, :enum, list: [:normal, :fast], default: :normal, alias: :parser_type
|
32
32
|
|
33
33
|
def configure(conf)
|
34
34
|
super
|
35
35
|
|
36
36
|
|
37
|
-
if @
|
37
|
+
if @parser_engine == :fast
|
38
38
|
@quote_char = '"'
|
39
39
|
@escape_pattern = Regexp.compile(@quote_char * 2)
|
40
40
|
|
@@ -56,7 +56,7 @@ module Fluent
|
|
56
56
|
desc 'Specify time format for event time for rfc5424 protocol'
|
57
57
|
config_param :rfc5424_time_format, :string, default: "%Y-%m-%dT%H:%M:%S.%L%z"
|
58
58
|
desc 'The parser type used to parse syslog message'
|
59
|
-
config_param :
|
59
|
+
config_param :parser_engine, :enum, list: [:regexp, :string], default: :regexp, alias: :parser_type
|
60
60
|
desc 'support colonless ident in string parser'
|
61
61
|
config_param :support_colonless_ident, :bool, default: true
|
62
62
|
|
@@ -79,7 +79,7 @@ module Fluent
|
|
79
79
|
def configure(conf)
|
80
80
|
super
|
81
81
|
|
82
|
-
@regexp_parser = @
|
82
|
+
@regexp_parser = @parser_engine == :regexp
|
83
83
|
@regexp = case @message_format
|
84
84
|
when :rfc3164
|
85
85
|
if @regexp_parser
|
@@ -130,7 +130,7 @@ module Fluent
|
|
130
130
|
|
131
131
|
def save
|
132
132
|
return if @on_memory
|
133
|
-
tmp_path = @path + '.tmp'
|
133
|
+
tmp_path = @path + '.tmp.' + Fluent::UniqueId.hex(Fluent::UniqueId.generate)
|
134
134
|
begin
|
135
135
|
json_string = Yajl::Encoder.encode(@store, pretty: @pretty_print)
|
136
136
|
File.open(tmp_path, 'w:utf-8', @mode) { |io| io.write json_string; io.fsync }
|
@@ -709,11 +709,13 @@ module Fluent
|
|
709
709
|
return true
|
710
710
|
end
|
711
711
|
rescue Errno::EPIPE, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH => e
|
712
|
-
@log.trace "unexpected error before accepting TLS connection",
|
712
|
+
@log.trace "unexpected error before accepting TLS connection",
|
713
|
+
host: @_handler_socket.peeraddr[3], port: @_handler_socket.peeraddr[1], error: e
|
713
714
|
close rescue nil
|
714
715
|
rescue OpenSSL::SSL::SSLError => e
|
715
716
|
# Use same log level as on_readable
|
716
|
-
@log.warn "unexpected error before accepting TLS connection by OpenSSL",
|
717
|
+
@log.warn "unexpected error before accepting TLS connection by OpenSSL",
|
718
|
+
host: @_handler_socket.peeraddr[3], port: @_handler_socket.peeraddr[1], error: e
|
717
719
|
close rescue nil
|
718
720
|
end
|
719
721
|
|
@@ -38,8 +38,8 @@ module Fluent
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
if send_keepalive_packet
|
41
|
-
if protocol != :tcp
|
42
|
-
raise ArgumentError, "BUG: send_keepalive_packet is available for tcp"
|
41
|
+
if protocol != :tcp && protocol != :tls
|
42
|
+
raise ArgumentError, "BUG: send_keepalive_packet is available for tcp/tls"
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
data/lib/fluent/version.rb
CHANGED
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.test_files = test_files
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_development_dependency "bundler", "~>
|
24
|
-
spec.add_development_dependency "rake", "~>
|
25
|
-
spec.add_development_dependency "test-unit", "~>
|
23
|
+
spec.add_development_dependency "bundler", "~> <%= bundler_version %>"
|
24
|
+
spec.add_development_dependency "rake", "~> <%= rake_version %>"
|
25
|
+
spec.add_development_dependency "test-unit", "~> <%= test_unit_version %>"
|
26
26
|
spec.add_runtime_dependency "fluentd", [">= 0.14.10", "< 2"]
|
27
27
|
end
|
@@ -81,8 +81,6 @@ class ConnectionManager < Test::Unit::TestCase
|
|
81
81
|
|
82
82
|
sub_test_case 'when socket_cache exists' do
|
83
83
|
test 'calls connect_keepalive' do
|
84
|
-
omit "Proxy of RR doesn't support kwargs of Ruby 3 yet" if RUBY_VERSION.split('.')[0].to_i >= 3
|
85
|
-
|
86
84
|
cache = Fluent::Plugin::ForwardOutput::SocketCache.new(10, $log)
|
87
85
|
mock(cache).checkin('sock').never
|
88
86
|
|
@@ -101,8 +99,6 @@ class ConnectionManager < Test::Unit::TestCase
|
|
101
99
|
end
|
102
100
|
|
103
101
|
test 'calls connect_keepalive and closes socket with block' do
|
104
|
-
omit "Proxy of RR doesn't support kwargs of Ruby 3 yet" if RUBY_VERSION.split('.')[0].to_i >= 3
|
105
|
-
|
106
102
|
cache = Fluent::Plugin::ForwardOutput::SocketCache.new(10, $log)
|
107
103
|
mock(cache).checkin('sock').once
|
108
104
|
|
@@ -122,8 +118,6 @@ class ConnectionManager < Test::Unit::TestCase
|
|
122
118
|
end
|
123
119
|
|
124
120
|
test 'does not call dec_ref when ack is passed' do
|
125
|
-
omit "Proxy of RR doesn't support kwargs of Ruby 3 yet" if RUBY_VERSION.split('.')[0].to_i >= 3
|
126
|
-
|
127
121
|
cache = Fluent::Plugin::ForwardOutput::SocketCache.new(10, $log)
|
128
122
|
mock(cache).checkin('sock').never
|
129
123
|
sock = 'sock'
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require_relative '../helper'
|
2
|
+
require 'fluent/plugin/file_wrapper'
|
3
|
+
|
4
|
+
class FileWrapperTest < Test::Unit::TestCase
|
5
|
+
require 'windows/file'
|
6
|
+
require 'windows/error'
|
7
|
+
include Windows::File
|
8
|
+
include Windows::Error
|
9
|
+
|
10
|
+
TMP_DIR = File.dirname(__FILE__) + "/../tmp/file_wrapper#{ENV['TEST_ENV_NUMBER']}"
|
11
|
+
|
12
|
+
def setup
|
13
|
+
FileUtils.mkdir_p(TMP_DIR)
|
14
|
+
end
|
15
|
+
|
16
|
+
def teardown
|
17
|
+
FileUtils.rm_rf(TMP_DIR)
|
18
|
+
end
|
19
|
+
|
20
|
+
sub_test_case 'Win32Error' do
|
21
|
+
test 'equal' do
|
22
|
+
assert_equal(Fluent::Win32Error.new(ERROR_SHARING_VIOLATION, "message"),
|
23
|
+
Fluent::Win32Error.new(ERROR_SHARING_VIOLATION, "message"))
|
24
|
+
end
|
25
|
+
|
26
|
+
test 'different error code' do
|
27
|
+
assert_not_equal(Fluent::Win32Error.new(ERROR_FILE_NOT_FOUND),
|
28
|
+
Fluent::Win32Error.new(ERROR_SHARING_VIOLATION))
|
29
|
+
end
|
30
|
+
|
31
|
+
test 'different error message' do
|
32
|
+
assert_not_equal(Fluent::Win32Error.new(ERROR_FILE_NOT_FOUND, "message1"),
|
33
|
+
Fluent::Win32Error.new(ERROR_FILE_NOT_FOUND, "message2"))
|
34
|
+
end
|
35
|
+
|
36
|
+
test 'different class' do
|
37
|
+
assert_not_equal(Errno::EPIPE,
|
38
|
+
Fluent::Win32Error.new(ERROR_SHARING_VIOLATION))
|
39
|
+
end
|
40
|
+
|
41
|
+
test 'ERROR_SHARING_VIOLATION message' do
|
42
|
+
assert_equal(Fluent::Win32Error.new(ERROR_SHARING_VIOLATION).message,
|
43
|
+
"Fluent::Win32Error: code: 32, The process cannot access the file because it is being used by another process.")
|
44
|
+
end
|
45
|
+
|
46
|
+
test 'ERROR_SHARING_VIOLATION with a message' do
|
47
|
+
assert_equal(Fluent::Win32Error.new(ERROR_SHARING_VIOLATION, "cannot open the file").message,
|
48
|
+
"Fluent::Win32Error: code: 32, The process cannot access the file because it is being used by another process." +
|
49
|
+
" - cannot open the file")
|
50
|
+
end
|
51
|
+
|
52
|
+
test 'to_s' do
|
53
|
+
assert_equal("Fluent::Win32Error: code: 32, The process cannot access the file because it is being used by another process. - C:\file.txt",
|
54
|
+
Fluent::Win32Error.new(ERROR_SHARING_VIOLATION, "C:\file.txt").to_s)
|
55
|
+
end
|
56
|
+
|
57
|
+
test 'inspect' do
|
58
|
+
assert_equal("#<Fluent::Win32Error: code: 32, The process cannot access the file because it is being used by another process. - C:\file.txt>",
|
59
|
+
Fluent::Win32Error.new(ERROR_SHARING_VIOLATION, "C:\file.txt").inspect)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
sub_test_case 'WindowsFile exceptions' do
|
64
|
+
test 'nothing raised' do
|
65
|
+
begin
|
66
|
+
path = "#{TMP_DIR}/test_windows_file.txt"
|
67
|
+
file1 = file2 = nil
|
68
|
+
file1 = File.open(path, "wb") do |f|
|
69
|
+
end
|
70
|
+
assert_nothing_raised do
|
71
|
+
file2 = Fluent::WindowsFile.new(path)
|
72
|
+
ensure
|
73
|
+
file2.close
|
74
|
+
end
|
75
|
+
ensure
|
76
|
+
file1.close if file1
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
test 'Errno::ENOENT raised' do
|
81
|
+
path = "#{TMP_DIR}/nofile.txt"
|
82
|
+
file = nil
|
83
|
+
assert_raise(Errno::ENOENT) do
|
84
|
+
file = Fluent::WindowsFile.new(path)
|
85
|
+
ensure
|
86
|
+
file.close if file
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
test 'ERROR_SHARING_VIOLATION raised' do
|
91
|
+
begin
|
92
|
+
path = "#{TMP_DIR}/test_windows_file.txt"
|
93
|
+
file1 = file2 = nil
|
94
|
+
file1 = File.open(path, "wb")
|
95
|
+
assert_raise(Fluent::Win32Error.new(ERROR_SHARING_VIOLATION, path)) do
|
96
|
+
file2 = Fluent::WindowsFile.new(path, 'r', FILE_SHARE_READ)
|
97
|
+
ensure
|
98
|
+
file2.close if file2
|
99
|
+
end
|
100
|
+
ensure
|
101
|
+
file1.close if file1
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end if Fluent.windows?
|
data/test/plugin/test_in_tail.rb
CHANGED
@@ -589,6 +589,7 @@ class TailInputTest < Test::Unit::TestCase
|
|
589
589
|
File.open("#{TMP_DIR}/tail.txt", "wb") {|f|
|
590
590
|
f.puts "test1"
|
591
591
|
f.puts "test2"
|
592
|
+
f.flush
|
592
593
|
}
|
593
594
|
|
594
595
|
d = create_driver(config)
|
@@ -598,19 +599,23 @@ class TailInputTest < Test::Unit::TestCase
|
|
598
599
|
f.puts "test3\ntest4"
|
599
600
|
f.flush
|
600
601
|
}
|
601
|
-
sleep 1
|
602
|
+
waiting(2) { sleep 0.1 until d.events.length == 2 }
|
602
603
|
File.truncate("#{TMP_DIR}/tail.txt", 6)
|
603
604
|
end
|
604
605
|
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
606
|
+
expected = {
|
607
|
+
emit_count: 2,
|
608
|
+
events: [
|
609
|
+
[Fluent::EventTime, {"message" => "test3"}],
|
610
|
+
[Fluent::EventTime, {"message" => "test4"}],
|
611
|
+
[Fluent::EventTime, {"message" => "test1"}],
|
612
|
+
]
|
613
|
+
}
|
614
|
+
actual = {
|
615
|
+
emit_count: d.emit_count,
|
616
|
+
events: d.events.collect{|event| [event[1].class, event[2]]}
|
617
|
+
}
|
618
|
+
assert_equal(expected, actual)
|
614
619
|
end
|
615
620
|
|
616
621
|
def test_move_truncate_move_back
|
@@ -1914,4 +1919,22 @@ class TailInputTest < Test::Unit::TestCase
|
|
1914
1919
|
waiting(5) { sleep 0.1 until d.instance.instance_variable_get(:@tails).keys.size == 1 }
|
1915
1920
|
d.instance_shutdown
|
1916
1921
|
end
|
1922
|
+
|
1923
|
+
def test_ENOENT_error_after_setup_watcher
|
1924
|
+
path = "#{TMP_DIR}/tail.txt"
|
1925
|
+
FileUtils.touch(path)
|
1926
|
+
config = config_element('', '', {
|
1927
|
+
'format' => 'none',
|
1928
|
+
})
|
1929
|
+
d = create_driver(config)
|
1930
|
+
mock.proxy(d.instance).setup_watcher(anything, anything) do |tw|
|
1931
|
+
cleanup_file(path)
|
1932
|
+
tw
|
1933
|
+
end
|
1934
|
+
assert_nothing_raised do
|
1935
|
+
d.run(shutdown: false) {}
|
1936
|
+
end
|
1937
|
+
d.instance_shutdown
|
1938
|
+
assert($log.out.logs.any?{|log| log.include?("stat() for #{path} failed with ENOENT. Drop tail watcher for now.\n") })
|
1939
|
+
end
|
1917
1940
|
end
|
@@ -587,31 +587,36 @@ EOL
|
|
587
587
|
flush_mode immediate
|
588
588
|
retry_type periodic
|
589
589
|
retry_wait 30s
|
590
|
-
flush_at_shutdown
|
590
|
+
flush_at_shutdown true
|
591
591
|
</buffer>
|
592
592
|
])
|
593
593
|
|
594
594
|
time = event_time("2011-01-02 13:14:15 UTC")
|
595
595
|
|
596
596
|
acked_chunk_ids = []
|
597
|
+
nacked = false
|
597
598
|
mock.proxy(d.instance.ack_handler).read_ack_from_sock(anything) do |info, success|
|
598
599
|
if success
|
599
600
|
acked_chunk_ids << info.chunk_id
|
601
|
+
else
|
602
|
+
nacked = true
|
600
603
|
end
|
601
|
-
[
|
604
|
+
[info, success]
|
602
605
|
end
|
603
606
|
|
604
607
|
records = [
|
605
608
|
{"a" => 1},
|
606
609
|
{"a" => 2}
|
607
610
|
]
|
608
|
-
target_input_driver.run(expect_records: 2) do
|
609
|
-
d.end_if { acked_chunk_ids.size > 0 }
|
611
|
+
target_input_driver.run(expect_records: 2, timeout: 5) do
|
612
|
+
d.end_if { acked_chunk_ids.size > 0 || nacked }
|
610
613
|
d.run(default_tag: 'test', wait_flush_completion: false, shutdown: false) do
|
611
614
|
d.feed([[time, records[0]], [time,records[1]]])
|
612
615
|
end
|
613
616
|
end
|
614
617
|
|
618
|
+
assert(!nacked, d.instance.log.logs.join)
|
619
|
+
|
615
620
|
events = target_input_driver.events
|
616
621
|
assert_equal ['test', time, records[0]], events[0]
|
617
622
|
assert_equal ['test', time, records[1]], events[1]
|
@@ -630,26 +635,29 @@ EOL
|
|
630
635
|
flush_mode immediate
|
631
636
|
retry_type periodic
|
632
637
|
retry_wait 30s
|
633
|
-
flush_at_shutdown
|
638
|
+
flush_at_shutdown true
|
634
639
|
</buffer>
|
635
640
|
])
|
636
641
|
|
637
642
|
time = event_time("2011-01-02 13:14:15 UTC")
|
638
643
|
|
639
644
|
acked_chunk_ids = []
|
645
|
+
nacked = false
|
640
646
|
mock.proxy(d.instance.ack_handler).read_ack_from_sock(anything) do |info, success|
|
641
647
|
if success
|
642
648
|
acked_chunk_ids << info.chunk_id
|
649
|
+
else
|
650
|
+
nacked = true
|
643
651
|
end
|
644
|
-
[
|
652
|
+
[info, success]
|
645
653
|
end
|
646
654
|
|
647
655
|
records = [
|
648
656
|
{"a" => 1},
|
649
657
|
{"a" => 2}
|
650
658
|
]
|
651
|
-
target_input_driver.run(expect_records: 2) do
|
652
|
-
d.end_if { acked_chunk_ids.size > 0 }
|
659
|
+
target_input_driver.run(expect_records: 2, timeout: 5) do
|
660
|
+
d.end_if { acked_chunk_ids.size > 0 || nacked }
|
653
661
|
d.run(default_tag: 'test', wait_flush_completion: false, shutdown: false) do
|
654
662
|
d.instance.stop
|
655
663
|
d.feed([[time, records[0]], [time,records[1]]])
|
@@ -659,6 +667,8 @@ EOL
|
|
659
667
|
end
|
660
668
|
end
|
661
669
|
|
670
|
+
assert(!nacked, d.instance.log.logs.join)
|
671
|
+
|
662
672
|
events = target_input_driver.events
|
663
673
|
assert_equal ['test', time, records[0]], events[0]
|
664
674
|
assert_equal ['test', time, records[1]], events[1]
|
@@ -1061,11 +1071,9 @@ EOL
|
|
1061
1071
|
end
|
1062
1072
|
|
1063
1073
|
test 'when out_forward has @id' do
|
1064
|
-
omit "Proxy of RR doesn't support kwargs of Ruby 3 yet" if RUBY_VERSION.split('.')[0].to_i >= 3
|
1065
|
-
|
1066
1074
|
# cancel https://github.com/fluent/fluentd/blob/077508ac817b7637307434d0c978d7cdc3d1c534/lib/fluent/plugin_id.rb#L43-L53
|
1067
1075
|
# it always return true in test
|
1068
|
-
mock.proxy(Fluent::Plugin).new_sd(:static, anything) { |v|
|
1076
|
+
mock.proxy(Fluent::Plugin).new_sd(:static, parent: anything) { |v|
|
1069
1077
|
stub(v).plugin_id_for_test? { false }
|
1070
1078
|
}.once
|
1071
1079
|
|
@@ -1296,7 +1304,13 @@ EOL
|
|
1296
1304
|
|
1297
1305
|
begin
|
1298
1306
|
chunk = Fluent::Plugin::Buffer::MemoryChunk.new(Fluent::Plugin::Buffer::Metadata.new(nil, nil, nil))
|
1299
|
-
mock.proxy(d.instance).socket_create_tcp(TARGET_HOST, TARGET_PORT,
|
1307
|
+
mock.proxy(d.instance).socket_create_tcp(TARGET_HOST, TARGET_PORT,
|
1308
|
+
linger_timeout: anything,
|
1309
|
+
send_timeout: anything,
|
1310
|
+
recv_timeout: anything,
|
1311
|
+
connect_timeout: anything) { |sock|
|
1312
|
+
mock(sock).close.once; sock
|
1313
|
+
}.twice
|
1300
1314
|
|
1301
1315
|
target_input_driver.run(timeout: 15) do
|
1302
1316
|
d.run(shutdown: false) do
|
data/test/plugin/test_output.rb
CHANGED
@@ -390,6 +390,18 @@ class OutputTest < Test::Unit::TestCase
|
|
390
390
|
assert { logs.none? { |log| log.include?("${chunk_id}") } }
|
391
391
|
end
|
392
392
|
|
393
|
+
test '#extract_placeholders does not log for ${chunk_id} placeholder (with @chunk_keys)' do
|
394
|
+
@i.configure(config_element('ROOT', '', {}, [config_element('buffer', 'key1')]))
|
395
|
+
tmpl = "/mypath/${chunk_id}/${key1}/tail"
|
396
|
+
t = event_time('2016-04-11 20:30:00 +0900')
|
397
|
+
v = {key1: "value1", key2: "value2"}
|
398
|
+
c = create_chunk(timekey: t, tag: 'fluentd.test.output', variables: v)
|
399
|
+
@i.log.out.logs.clear
|
400
|
+
@i.extract_placeholders(tmpl, c)
|
401
|
+
logs = @i.log.out.logs
|
402
|
+
assert { logs.none? { |log| log.include?("${chunk_id}") } }
|
403
|
+
end
|
404
|
+
|
393
405
|
test '#extract_placeholders logs warn message with not replaced key' do
|
394
406
|
@i.configure(config_element('ROOT', '', {}, [config_element('buffer', '')]))
|
395
407
|
tmpl = "/mypath/${key1}/test"
|
@@ -868,7 +880,7 @@ class OutputTest < Test::Unit::TestCase
|
|
868
880
|
test "Warn if primary type is different from secondary type and either primary or secondary has custom_format" do
|
869
881
|
o = create_output(:buffered)
|
870
882
|
mock(o.log).warn("Use different plugin for secondary. Check the plugin works with primary like secondary_file",
|
871
|
-
|
883
|
+
primary: o.class.to_s, secondary: "Fluent::Plugin::TestOutput")
|
872
884
|
|
873
885
|
o.configure(config_element('ROOT','',{},[config_element('secondary','',{'@type'=>'test', 'name' => "cool"})]))
|
874
886
|
assert_not_nil o.instance_variable_get(:@secondary)
|
@@ -877,7 +889,7 @@ class OutputTest < Test::Unit::TestCase
|
|
877
889
|
test "don't warn if primary type is the same as secondary type" do
|
878
890
|
o = Fluent::Plugin::TestOutput.new
|
879
891
|
mock(o.log).warn("Use different plugin for secondary. Check the plugin works with primary like secondary_file",
|
880
|
-
|
892
|
+
primary: o.class.to_s, secondary: "Fluent::Plugin::TestOutput" ).never
|
881
893
|
|
882
894
|
o.configure(config_element('ROOT','',{'name' => "cool2"},
|
883
895
|
[config_element('secondary','',{'@type'=>'test', 'name' => "cool"}),
|
@@ -889,7 +901,7 @@ class OutputTest < Test::Unit::TestCase
|
|
889
901
|
test "don't warn if primary type is different from secondary type and both don't have custom_format" do
|
890
902
|
o = create_output(:standard)
|
891
903
|
mock(o.log).warn("Use different plugin for secondary. Check the plugin works with primary like secondary_file",
|
892
|
-
|
904
|
+
primary: o.class.to_s, secondary: "Fluent::Plugin::TestOutput").never
|
893
905
|
|
894
906
|
o.configure(config_element('ROOT','',{},[config_element('secondary','',{'@type'=>'test', 'name' => "cool"})]))
|
895
907
|
assert_not_nil o.instance_variable_get(:@secondary)
|
@@ -173,6 +173,8 @@ class BufferedOutputBackupTest < Test::Unit::TestCase
|
|
173
173
|
waiting(5) {
|
174
174
|
target_dir = File.join(File.dirname(target_file), "*")
|
175
175
|
while Dir.glob(target_dir).size.zero?
|
176
|
+
# Avoid to lose globbed entries on Windows in busy loop
|
177
|
+
sleep 0.1 if Fluent.windows?
|
176
178
|
end
|
177
179
|
}
|
178
180
|
end
|
@@ -183,4 +183,18 @@ class CSVParserTest < ::Test::Unit::TestCase
|
|
183
183
|
# And more...
|
184
184
|
end
|
185
185
|
end
|
186
|
+
|
187
|
+
# "parser_type" config shouldn't hide Fluent::Plugin::Parser#plugin_type
|
188
|
+
# https://github.com/fluent/fluentd/issues/3296
|
189
|
+
data('normal' => :normal, 'fast' => :fast)
|
190
|
+
def test_parser_type_method(engine)
|
191
|
+
d = create_driver('keys' => '["time"]','time_key' => 'time', 'parser_type' => engine.to_s)
|
192
|
+
assert_equal(:text_per_line, d.instance.parser_type)
|
193
|
+
end
|
194
|
+
|
195
|
+
data('normal' => :normal, 'fast' => :fast)
|
196
|
+
def test_parser_engine(engine)
|
197
|
+
d = create_driver('keys' => '["time"]', 'time_key' => 'time', 'parser_engine' => engine.to_s)
|
198
|
+
assert_equal(engine, d.instance.parser_engine)
|
199
|
+
end
|
186
200
|
end
|
@@ -633,4 +633,18 @@ class SyslogParserTest < ::Test::Unit::TestCase
|
|
633
633
|
end
|
634
634
|
end
|
635
635
|
end
|
636
|
+
|
637
|
+
# "parser_type" config shouldn't hide Fluent::Plugin::Parser#plugin_type
|
638
|
+
# https://github.com/fluent/fluentd/issues/3296
|
639
|
+
data('regexp' => :regexp, 'fast' => :string)
|
640
|
+
def test_parser_type_method(engine)
|
641
|
+
@parser.configure({'parser_type' => engine.to_s})
|
642
|
+
assert_equal(:text_per_line, @parser.instance.parser_type)
|
643
|
+
end
|
644
|
+
|
645
|
+
data('regexp' => :regexp, 'string' => :string)
|
646
|
+
def test_parser_engine(engine)
|
647
|
+
d = @parser.configure({'parser_engine' => engine.to_s})
|
648
|
+
assert_equal(engine, @parser.instance.parser_engine)
|
649
|
+
end
|
636
650
|
end
|
@@ -71,7 +71,7 @@ class TestServiceDiscoveryManager < ::Test::Unit::TestCase
|
|
71
71
|
test 'if new service added and deleted' do
|
72
72
|
sdm = Fluent::PluginHelper::ServiceDiscovery::Manager.new(log: $log)
|
73
73
|
t = TestSdPlugin.new
|
74
|
-
mock(Fluent::Plugin).new_sd(:sd_test, anything) { t }
|
74
|
+
mock(Fluent::Plugin).new_sd(:sd_test, parent: anything) { t }
|
75
75
|
sdm.configure([{ type: :sd_test, conf: config_element('service_discovery', '', {})}])
|
76
76
|
sdm.start
|
77
77
|
|
@@ -354,7 +354,7 @@ class HttpHelperTest < Test::Unit::TestCase
|
|
354
354
|
watcher.should_receive(:stop).once
|
355
355
|
end
|
356
356
|
|
357
|
-
stub(Fluent::PluginHelper::HttpServer::Server).new(anything) { server }
|
357
|
+
stub(Fluent::PluginHelper::HttpServer::Server).new(addr: anything, port: anything, logger: anything, default_app: anything) { server }
|
358
358
|
driver.http_server_create_http_server(:http_server_helper_test, addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do
|
359
359
|
# nothing
|
360
360
|
end
|
@@ -234,7 +234,13 @@ class ServerPluginHelperTest < Test::Unit::TestCase
|
|
234
234
|
assert_raise(ArgumentError.new("BUG: backlog is available for tcp/tls")) do
|
235
235
|
@d.__send__(m, :myserver, PORT, proto: proto, backlog: 500){|x| x }
|
236
236
|
end
|
237
|
-
|
237
|
+
end
|
238
|
+
|
239
|
+
data(
|
240
|
+
'server_create udp' => [:server_create, :udp],
|
241
|
+
)
|
242
|
+
test 'raise error if tcp/tls send_keepalive_packet option is specified for udp' do |(m, proto)|
|
243
|
+
assert_raise(ArgumentError.new("BUG: send_keepalive_packet is available for tcp/tls")) do
|
238
244
|
@d.__send__(m, :myserver, PORT, proto: proto, send_keepalive_packet: true){|x| x }
|
239
245
|
end
|
240
246
|
end
|
@@ -1300,7 +1306,7 @@ class ServerPluginHelperTest < Test::Unit::TestCase
|
|
1300
1306
|
|
1301
1307
|
test 'can accept all keyword arguments valid for tcp/tls server' do
|
1302
1308
|
assert_nothing_raised do
|
1303
|
-
@d.server_create_tls(:s, PORT, bind: '127.0.0.1', shared: false, resolve_name: true, linger_timeout: 10, backlog: 500, tls_options: @tls_options) do |data, conn|
|
1309
|
+
@d.server_create_tls(:s, PORT, bind: '127.0.0.1', shared: false, resolve_name: true, linger_timeout: 10, backlog: 500, tls_options: @tls_options, send_keepalive_packet: true) do |data, conn|
|
1304
1310
|
# ...
|
1305
1311
|
end
|
1306
1312
|
end
|
data/test/test_output.rb
CHANGED
@@ -117,7 +117,7 @@ module FluentOutputTest
|
|
117
117
|
end
|
118
118
|
|
119
119
|
mock(d.instance.log).warn("Use different plugin for secondary. Check the plugin works with primary like secondary_file",
|
120
|
-
|
120
|
+
primary: d.instance.class.to_s, secondary: "Fluent::Plugin::Test2Output")
|
121
121
|
d.configure(CONFIG + %[
|
122
122
|
<secondary>
|
123
123
|
type test2
|
@@ -133,7 +133,7 @@ module FluentOutputTest
|
|
133
133
|
d = Fluent::Test::BufferedOutputTestDriver.new(Fluent::ObjectBufferedOutput)
|
134
134
|
|
135
135
|
mock(d.instance.log).warn("Use different plugin for secondary. Check the plugin works with primary like secondary_file",
|
136
|
-
|
136
|
+
primary: d.instance.class.to_s, secondary: "Fluent::Plugin::Test2Output").never
|
137
137
|
d.configure(CONFIG + %[
|
138
138
|
<secondary>
|
139
139
|
type test2
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluentd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.3
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -206,20 +206,40 @@ dependencies:
|
|
206
206
|
- - "<"
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: 1.8.0
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: win32-api
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '1.10'
|
216
|
+
- - "<"
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: 2.0.0
|
219
|
+
type: :runtime
|
220
|
+
prerelease: false
|
221
|
+
version_requirements: !ruby/object:Gem::Requirement
|
222
|
+
requirements:
|
223
|
+
- - ">="
|
224
|
+
- !ruby/object:Gem::Version
|
225
|
+
version: '1.10'
|
226
|
+
- - "<"
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: 2.0.0
|
209
229
|
- !ruby/object:Gem::Dependency
|
210
230
|
name: win32-service
|
211
231
|
requirement: !ruby/object:Gem::Requirement
|
212
232
|
requirements:
|
213
233
|
- - "~>"
|
214
234
|
- !ruby/object:Gem::Version
|
215
|
-
version: 2.
|
235
|
+
version: 2.2.0
|
216
236
|
type: :runtime
|
217
237
|
prerelease: false
|
218
238
|
version_requirements: !ruby/object:Gem::Requirement
|
219
239
|
requirements:
|
220
240
|
- - "~>"
|
221
241
|
- !ruby/object:Gem::Version
|
222
|
-
version: 2.
|
242
|
+
version: 2.2.0
|
223
243
|
- !ruby/object:Gem::Dependency
|
224
244
|
name: win32-ipc
|
225
245
|
requirement: !ruby/object:Gem::Requirement
|
@@ -338,14 +358,14 @@ dependencies:
|
|
338
358
|
requirements:
|
339
359
|
- - "~>"
|
340
360
|
- !ruby/object:Gem::Version
|
341
|
-
version: '
|
361
|
+
version: '3.0'
|
342
362
|
type: :development
|
343
363
|
prerelease: false
|
344
364
|
version_requirements: !ruby/object:Gem::Requirement
|
345
365
|
requirements:
|
346
366
|
- - "~>"
|
347
367
|
- !ruby/object:Gem::Version
|
348
|
-
version: '
|
368
|
+
version: '3.0'
|
349
369
|
- !ruby/object:Gem::Dependency
|
350
370
|
name: timecop
|
351
371
|
requirement: !ruby/object:Gem::Requirement
|
@@ -830,6 +850,7 @@ files:
|
|
830
850
|
- test/plugin/test_buffer_memory_chunk.rb
|
831
851
|
- test/plugin/test_compressable.rb
|
832
852
|
- test/plugin/test_file_util.rb
|
853
|
+
- test/plugin/test_file_wrapper.rb
|
833
854
|
- test/plugin/test_filter.rb
|
834
855
|
- test/plugin/test_filter_grep.rb
|
835
856
|
- test/plugin/test_filter_parser.rb
|
@@ -1001,7 +1022,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1001
1022
|
- !ruby/object:Gem::Version
|
1002
1023
|
version: '0'
|
1003
1024
|
requirements: []
|
1004
|
-
rubygems_version: 3.2
|
1025
|
+
rubygems_version: 3.1.2
|
1005
1026
|
signing_key:
|
1006
1027
|
specification_version: 4
|
1007
1028
|
summary: Fluentd event collector
|
@@ -1067,6 +1088,7 @@ test_files:
|
|
1067
1088
|
- test/plugin/test_buffer_memory_chunk.rb
|
1068
1089
|
- test/plugin/test_compressable.rb
|
1069
1090
|
- test/plugin/test_file_util.rb
|
1091
|
+
- test/plugin/test_file_wrapper.rb
|
1070
1092
|
- test/plugin/test_filter.rb
|
1071
1093
|
- test/plugin/test_filter_grep.rb
|
1072
1094
|
- test/plugin/test_filter_parser.rb
|