fluentd 1.15.1-x86-mingw32 → 1.15.2-x86-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/CHANGELOG.md +20 -0
- data/fluentd.gemspec +0 -3
- data/lib/fluent/command/fluentd.rb +1 -6
- data/lib/fluent/plugin/file_wrapper.rb +7 -8
- data/lib/fluent/plugin_helper/child_process.rb +3 -0
- data/lib/fluent/supervisor.rb +17 -11
- data/lib/fluent/system_config.rb +2 -1
- data/lib/fluent/version.rb +1 -1
- data/lib/fluent/win32api.rb +38 -0
- data/lib/fluent/winsvc.rb +3 -8
- data/test/config/test_system_config.rb +2 -0
- data/test/plugin/test_file_wrapper.rb +0 -5
- metadata +4 -51
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 151a6147f8d056032028f95746086afaa48f9d6335c41196a2269fb8c9ed1fdd
|
4
|
+
data.tar.gz: bc7da3f9b2bc71818d69dad63d5692365d09c75bab57b880c1900c2e7c47c404
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c396e5fb10f0ee63082445ab087b1dc556b5271d28a334ae5bad41ec8d570db4f85d03153ec43418f050dc23536976c121656667899899a44ba8373074cdf9a
|
7
|
+
data.tar.gz: 01e93aacc411435f5aa36e6d428508b587bde5ed690e4ba7c35acd3ea08118acbaab376cdc5f8384a73f173227b7b48cb100e76a9c43c3f637a1d55a1bd1aa20
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# v1.15
|
2
2
|
|
3
|
+
## Release v1.15.2 - 2022/08/22
|
4
|
+
|
5
|
+
### Enhancement
|
6
|
+
|
7
|
+
* Add a new system configuration `enable_jit`
|
8
|
+
https://github.com/fluent/fluentd/pull/3857
|
9
|
+
|
10
|
+
### Bug Fix
|
11
|
+
|
12
|
+
* out_file: Fix append mode with `--daemon` flag
|
13
|
+
https://github.com/fluent/fluentd/pull/3864
|
14
|
+
* child_process: Plug file descriptor leak
|
15
|
+
https://github.com/fluent/fluentd/pull/3844
|
16
|
+
|
17
|
+
### Misc
|
18
|
+
|
19
|
+
* Drop win32-api gem to support Ruby 3.2
|
20
|
+
https://github.com/fluent/fluentd/pull/3849
|
21
|
+
https://github.com/fluent/fluentd/pull/3866
|
22
|
+
|
3
23
|
## Release v1.15.1 - 2022/07/27
|
4
24
|
|
5
25
|
### Bug Fix
|
data/fluentd.gemspec
CHANGED
@@ -34,12 +34,9 @@ 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-api", [">= 1.10", "< 2.0.0"])
|
38
37
|
gem.add_runtime_dependency("win32-service", ["~> 2.3.0"])
|
39
38
|
gem.add_runtime_dependency("win32-ipc", ["~> 0.7.0"])
|
40
39
|
gem.add_runtime_dependency("win32-event", ["~> 0.6.3"])
|
41
|
-
gem.add_runtime_dependency("windows-api", ["~> 0.4.5"])
|
42
|
-
gem.add_runtime_dependency("windows-pr", ["~> 1.2.6"])
|
43
40
|
gem.add_runtime_dependency("certstore_c", ["~> 0.1.7"])
|
44
41
|
end
|
45
42
|
|
@@ -189,9 +189,6 @@ op.on('--disable-shared-socket', "Don't open shared socket for multiple workers"
|
|
189
189
|
}
|
190
190
|
|
191
191
|
if Fluent.windows?
|
192
|
-
require 'windows/library'
|
193
|
-
include Windows::Library
|
194
|
-
|
195
192
|
opts.merge!(
|
196
193
|
:winsvc_name => 'fluentdwinsvc',
|
197
194
|
:winsvc_display_name => 'Fluentd Windows Service',
|
@@ -292,9 +289,7 @@ if winsvcinstmode = opts[:regwinsvc]
|
|
292
289
|
case winsvcinstmode
|
293
290
|
when 'i'
|
294
291
|
binary_path = File.join(File.dirname(__FILE__), "..")
|
295
|
-
ruby_path =
|
296
|
-
GetModuleFileName.call(0,ruby_path,256)
|
297
|
-
ruby_path = ruby_path.rstrip.gsub(/\\/, '/')
|
292
|
+
ruby_path = ServerEngine.ruby_bin_path
|
298
293
|
start_type = Service::DEMAND_START
|
299
294
|
if opts[:regwinsvcautostart]
|
300
295
|
start_type = Service::AUTO_START
|
@@ -14,6 +14,8 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
+
require 'fluent/win32api'
|
18
|
+
|
17
19
|
module Fluent
|
18
20
|
module FileWrapper
|
19
21
|
def self.open(path, mode='r')
|
@@ -36,19 +38,16 @@ module Fluent
|
|
36
38
|
end
|
37
39
|
|
38
40
|
class WindowsFile
|
39
|
-
require 'windows/file'
|
40
|
-
require 'windows/handle'
|
41
|
-
|
42
41
|
include File::Constants
|
43
|
-
include Windows::File
|
44
|
-
include Windows::Handle
|
45
42
|
|
46
43
|
attr_reader :io
|
47
44
|
|
45
|
+
INVALID_HANDLE_VALUE = -1
|
46
|
+
|
48
47
|
def initialize(path, mode='r')
|
49
48
|
@path = path
|
50
49
|
@io = File.open(path, mode2flags(mode))
|
51
|
-
@file_handle = _get_osfhandle(@io.to_i)
|
50
|
+
@file_handle = Win32API._get_osfhandle(@io.to_i)
|
52
51
|
@io.instance_variable_set(:@file_index, self.ino)
|
53
52
|
def @io.ino
|
54
53
|
@file_index
|
@@ -68,7 +67,7 @@ module Fluent
|
|
68
67
|
def ino
|
69
68
|
by_handle_file_information = '\0'*(4+8+8+8+4+4+4+4+4+4) #72bytes
|
70
69
|
|
71
|
-
unless GetFileInformationByHandle
|
70
|
+
unless Win32API.GetFileInformationByHandle(@file_handle, by_handle_file_information)
|
72
71
|
return 0
|
73
72
|
end
|
74
73
|
|
@@ -122,7 +121,7 @@ module Fluent
|
|
122
121
|
bufsize = 1024
|
123
122
|
buf = '\0' * bufsize
|
124
123
|
|
125
|
-
unless GetFileInformationByHandleEx
|
124
|
+
unless Win32API.GetFileInformationByHandleEx(@file_handle, file_standard_info, buf, bufsize)
|
126
125
|
return false
|
127
126
|
end
|
128
127
|
|
@@ -346,6 +346,9 @@ module Fluent
|
|
346
346
|
if cb
|
347
347
|
cb.call(process_info.exit_status) rescue nil
|
348
348
|
end
|
349
|
+
process_info.readio&.close rescue nil
|
350
|
+
process_info.writeio&.close rescue nil
|
351
|
+
process_info.stderrio&.close rescue nil
|
349
352
|
end
|
350
353
|
thread[:_fluentd_plugin_helper_child_process_running] = true
|
351
354
|
thread[:_fluentd_plugin_helper_child_process_pid] = pid
|
data/lib/fluent/supervisor.rb
CHANGED
@@ -32,12 +32,6 @@ require 'fluent/variable_store'
|
|
32
32
|
require 'serverengine'
|
33
33
|
|
34
34
|
if Fluent.windows?
|
35
|
-
require 'windows/library'
|
36
|
-
require 'windows/synchronize'
|
37
|
-
require 'windows/system_info'
|
38
|
-
include Windows::Library
|
39
|
-
include Windows::Synchronize
|
40
|
-
include Windows::SystemInfo
|
41
35
|
require 'win32/ipc'
|
42
36
|
require 'win32/event'
|
43
37
|
end
|
@@ -50,6 +44,9 @@ module Fluent
|
|
50
44
|
@rpc_server = nil
|
51
45
|
@counter = nil
|
52
46
|
|
47
|
+
@fluentd_lock_dir = Dir.mktmpdir("fluentd-lock-")
|
48
|
+
ENV['FLUENTD_LOCK_DIR'] = @fluentd_lock_dir
|
49
|
+
|
53
50
|
if config[:rpc_endpoint]
|
54
51
|
@rpc_endpoint = config[:rpc_endpoint]
|
55
52
|
@enable_get_dump = config[:enable_get_dump]
|
@@ -79,9 +76,15 @@ module Fluent
|
|
79
76
|
stop_windows_event_thread if Fluent.windows?
|
80
77
|
stop_rpc_server if @rpc_endpoint
|
81
78
|
stop_counter_server if @counter
|
79
|
+
cleanup_lock_dir
|
82
80
|
Fluent::Supervisor.cleanup_resources
|
83
81
|
end
|
84
82
|
|
83
|
+
def cleanup_lock_dir
|
84
|
+
FileUtils.rm(Dir.glob(File.join(@fluentd_lock_dir, "fluentd-*.lock")))
|
85
|
+
FileUtils.rmdir(@fluentd_lock_dir)
|
86
|
+
end
|
87
|
+
|
85
88
|
def run_rpc_server
|
86
89
|
@rpc_server = RPC::Server.new(@rpc_endpoint, $log)
|
87
90
|
|
@@ -235,7 +238,8 @@ module Fluent
|
|
235
238
|
end
|
236
239
|
begin
|
237
240
|
loop do
|
238
|
-
|
241
|
+
infinite = 0xFFFFFFFF
|
242
|
+
ipc_idx = ipc.wait_any(events.map {|e| e[:win32_event]}, infinite)
|
239
243
|
event_idx = ipc_idx - 1
|
240
244
|
|
241
245
|
if event_idx >= 0 && event_idx < events.length
|
@@ -876,10 +880,7 @@ module Fluent
|
|
876
880
|
Fluent::Supervisor.load_config(@config_path, params)
|
877
881
|
}
|
878
882
|
|
879
|
-
|
880
|
-
ENV['FLUENTD_LOCK_DIR'] = lock_dir
|
881
|
-
se.run
|
882
|
-
end
|
883
|
+
se.run
|
883
884
|
end
|
884
885
|
|
885
886
|
def install_main_process_signal_handlers
|
@@ -1104,6 +1105,11 @@ module Fluent
|
|
1104
1105
|
fluentd_spawn_cmd << '-Eascii-8bit:ascii-8bit'
|
1105
1106
|
end
|
1106
1107
|
|
1108
|
+
if @system_config.enable_jit
|
1109
|
+
$log.info "enable Ruby JIT for workers (--jit)"
|
1110
|
+
fluentd_spawn_cmd << '--jit'
|
1111
|
+
end
|
1112
|
+
|
1107
1113
|
# Adding `-h` so that it can avoid ruby's command blocking
|
1108
1114
|
# e.g. `ruby -Eascii-8bit:ascii-8bit` will block. but `ruby -Eascii-8bit:ascii-8bit -h` won't.
|
1109
1115
|
_, e, s = Open3.capture3(*fluentd_spawn_cmd, "-h")
|
data/lib/fluent/system_config.rb
CHANGED
@@ -28,7 +28,7 @@ module Fluent
|
|
28
28
|
:without_source, :rpc_endpoint, :enable_get_dump, :process_name,
|
29
29
|
:file_permission, :dir_permission, :counter_server, :counter_client,
|
30
30
|
:strict_config_value, :enable_msgpack_time_support, :disable_shared_socket,
|
31
|
-
:metrics, :enable_input_metrics, :enable_size_metrics
|
31
|
+
:metrics, :enable_input_metrics, :enable_size_metrics, :enable_jit
|
32
32
|
]
|
33
33
|
|
34
34
|
config_param :workers, :integer, default: 1
|
@@ -50,6 +50,7 @@ module Fluent
|
|
50
50
|
config_param :disable_shared_socket, :bool, default: nil
|
51
51
|
config_param :enable_input_metrics, :bool, default: nil
|
52
52
|
config_param :enable_size_metrics, :bool, default: nil
|
53
|
+
config_param :enable_jit, :bool, default: false
|
53
54
|
config_param :file_permission, default: nil do |v|
|
54
55
|
v.to_i(8)
|
55
56
|
end
|
data/lib/fluent/version.rb
CHANGED
@@ -0,0 +1,38 @@
|
|
1
|
+
#
|
2
|
+
# Fluentd
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
require 'fluent/env'
|
18
|
+
|
19
|
+
module Fluent
|
20
|
+
module Win32API
|
21
|
+
require 'fiddle/import'
|
22
|
+
require 'fiddle/types'
|
23
|
+
extend Fiddle::Importer
|
24
|
+
|
25
|
+
if RUBY_PLATFORM.split('-')[-1] == "ucrt"
|
26
|
+
MSVCRT_DLL = 'ucrtbase.dll'
|
27
|
+
else
|
28
|
+
MSVCRT_DLL = 'msvcrt.dll'
|
29
|
+
end
|
30
|
+
|
31
|
+
dlload MSVCRT_DLL, "kernel32.dll"
|
32
|
+
include Fiddle::Win32Types
|
33
|
+
|
34
|
+
extern "intptr_t _get_osfhandle(int)"
|
35
|
+
extern "BOOL GetFileInformationByHandle(HANDLE, void *)"
|
36
|
+
extern "BOOL GetFileInformationByHandleEx(HANDLE, int, void *, DWORD)"
|
37
|
+
end if Fluent.windows?
|
38
|
+
end
|
data/lib/fluent/winsvc.rb
CHANGED
@@ -17,14 +17,12 @@
|
|
17
17
|
begin
|
18
18
|
|
19
19
|
require 'optparse'
|
20
|
-
require 'windows/debug'
|
21
|
-
require 'Windows/Library'
|
22
20
|
require 'win32/daemon'
|
23
21
|
require 'win32/event'
|
22
|
+
require 'win32/registry'
|
23
|
+
require 'serverengine'
|
24
24
|
|
25
25
|
include Win32
|
26
|
-
include Windows::Library
|
27
|
-
include Windows::Debug
|
28
26
|
|
29
27
|
op = OptionParser.new
|
30
28
|
opts = {service_name: nil}
|
@@ -37,16 +35,13 @@ begin
|
|
37
35
|
end
|
38
36
|
|
39
37
|
def read_fluentdopt(service_name)
|
40
|
-
require 'win32/Registry'
|
41
38
|
Win32::Registry::HKEY_LOCAL_MACHINE.open("SYSTEM\\CurrentControlSet\\Services\\#{service_name}") do |reg|
|
42
39
|
reg.read("fluentdopt")[1] rescue ""
|
43
40
|
end
|
44
41
|
end
|
45
42
|
|
46
43
|
def service_main_start(service_name)
|
47
|
-
ruby_path =
|
48
|
-
GetModuleFileName.call(0, ruby_path,260)
|
49
|
-
ruby_path = ruby_path.rstrip.gsub(/\\/, '/')
|
44
|
+
ruby_path = ServerEngine.ruby_bin_path
|
50
45
|
rubybin_dir = ruby_path[0, ruby_path.rindex("/")]
|
51
46
|
opt = read_fluentdopt(service_name)
|
52
47
|
Process.spawn("\"#{rubybin_dir}/ruby.exe\" \"#{rubybin_dir}/fluentd\" #{opt} -x #{service_name}")
|
@@ -84,6 +84,7 @@ module Fluent::Config
|
|
84
84
|
assert_nil(sc.enable_input_metrics)
|
85
85
|
assert_nil(sc.enable_size_metrics)
|
86
86
|
assert_nil(sc.enable_msgpack_time_support)
|
87
|
+
assert(!sc.enable_jit)
|
87
88
|
assert_equal(:text, sc.log.format)
|
88
89
|
assert_equal('%Y-%m-%d %H:%M:%S %z', sc.log.time_format)
|
89
90
|
end
|
@@ -102,6 +103,7 @@ module Fluent::Config
|
|
102
103
|
'enable_msgpack_time_support' => ['enable_msgpack_time_support', true],
|
103
104
|
'enable_input_metrics' => ['enable_input_metrics', true],
|
104
105
|
'enable_size_metrics' => ['enable_size_metrics', true],
|
106
|
+
'enable_jit' => ['enable_jit', true],
|
105
107
|
)
|
106
108
|
test "accepts parameters" do |(k, v)|
|
107
109
|
conf = parse_text(<<-EOS)
|
@@ -2,11 +2,6 @@ require_relative '../helper'
|
|
2
2
|
require 'fluent/plugin/file_wrapper'
|
3
3
|
|
4
4
|
class FileWrapperTest < Test::Unit::TestCase
|
5
|
-
require 'windows/file'
|
6
|
-
require 'windows/error'
|
7
|
-
include Windows::File
|
8
|
-
include Windows::Error
|
9
|
-
|
10
5
|
TMP_DIR = File.dirname(__FILE__) + "/../tmp/file_wrapper#{ENV['TEST_ENV_NUMBER']}"
|
11
6
|
|
12
7
|
def setup
|
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.15.
|
4
|
+
version: 1.15.2
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -206,26 +206,6 @@ 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
|
229
209
|
- !ruby/object:Gem::Dependency
|
230
210
|
name: win32-service
|
231
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -268,34 +248,6 @@ dependencies:
|
|
268
248
|
- - "~>"
|
269
249
|
- !ruby/object:Gem::Version
|
270
250
|
version: 0.6.3
|
271
|
-
- !ruby/object:Gem::Dependency
|
272
|
-
name: windows-api
|
273
|
-
requirement: !ruby/object:Gem::Requirement
|
274
|
-
requirements:
|
275
|
-
- - "~>"
|
276
|
-
- !ruby/object:Gem::Version
|
277
|
-
version: 0.4.5
|
278
|
-
type: :runtime
|
279
|
-
prerelease: false
|
280
|
-
version_requirements: !ruby/object:Gem::Requirement
|
281
|
-
requirements:
|
282
|
-
- - "~>"
|
283
|
-
- !ruby/object:Gem::Version
|
284
|
-
version: 0.4.5
|
285
|
-
- !ruby/object:Gem::Dependency
|
286
|
-
name: windows-pr
|
287
|
-
requirement: !ruby/object:Gem::Requirement
|
288
|
-
requirements:
|
289
|
-
- - "~>"
|
290
|
-
- !ruby/object:Gem::Version
|
291
|
-
version: 1.2.6
|
292
|
-
type: :runtime
|
293
|
-
prerelease: false
|
294
|
-
version_requirements: !ruby/object:Gem::Requirement
|
295
|
-
requirements:
|
296
|
-
- - "~>"
|
297
|
-
- !ruby/object:Gem::Version
|
298
|
-
version: 1.2.6
|
299
251
|
- !ruby/object:Gem::Dependency
|
300
252
|
name: certstore_c
|
301
253
|
requirement: !ruby/object:Gem::Requirement
|
@@ -809,6 +761,7 @@ files:
|
|
809
761
|
- lib/fluent/unique_id.rb
|
810
762
|
- lib/fluent/variable_store.rb
|
811
763
|
- lib/fluent/version.rb
|
764
|
+
- lib/fluent/win32api.rb
|
812
765
|
- lib/fluent/winsvc.rb
|
813
766
|
- templates/new_gem/Gemfile
|
814
767
|
- templates/new_gem/README.md.erb
|
@@ -1069,7 +1022,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1069
1022
|
- !ruby/object:Gem::Version
|
1070
1023
|
version: '0'
|
1071
1024
|
requirements: []
|
1072
|
-
rubygems_version: 3.3.
|
1025
|
+
rubygems_version: 3.3.17
|
1073
1026
|
signing_key:
|
1074
1027
|
specification_version: 4
|
1075
1028
|
summary: Fluentd event collector
|