fluentd 1.14.3-x64-mingw32 → 1.14.6-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.

Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/config.yml +2 -2
  3. data/.github/workflows/linux-test.yaml +1 -1
  4. data/.github/workflows/macos-test.yaml +5 -1
  5. data/.github/workflows/windows-test.yaml +6 -6
  6. data/CHANGELOG.md +79 -16
  7. data/CONTRIBUTING.md +1 -1
  8. data/MAINTAINERS.md +2 -2
  9. data/README.md +2 -23
  10. data/Rakefile +1 -1
  11. data/fluentd.gemspec +2 -1
  12. data/lib/fluent/command/fluentd.rb +4 -0
  13. data/lib/fluent/config/error.rb +12 -0
  14. data/lib/fluent/env.rb +4 -0
  15. data/lib/fluent/event_router.rb +19 -1
  16. data/lib/fluent/plugin/bare_output.rb +1 -1
  17. data/lib/fluent/plugin/base.rb +1 -1
  18. data/lib/fluent/plugin/buffer.rb +43 -23
  19. data/lib/fluent/plugin/in_forward.rb +1 -1
  20. data/lib/fluent/plugin/in_http.rb +11 -1
  21. data/lib/fluent/plugin/in_tail.rb +10 -0
  22. data/lib/fluent/plugin/out_file.rb +13 -1
  23. data/lib/fluent/plugin/output.rb +41 -32
  24. data/lib/fluent/plugin/parser.rb +3 -4
  25. data/lib/fluent/plugin_helper/retry_state.rb +14 -4
  26. data/lib/fluent/plugin_helper/server.rb +21 -4
  27. data/lib/fluent/plugin_helper/socket.rb +13 -2
  28. data/lib/fluent/registry.rb +2 -1
  29. data/lib/fluent/rpc.rb +4 -3
  30. data/lib/fluent/supervisor.rb +5 -2
  31. data/lib/fluent/version.rb +1 -1
  32. data/test/compat/test_parser.rb +1 -1
  33. data/test/plugin/test_bare_output.rb +1 -1
  34. data/test/plugin/test_buffer.rb +77 -0
  35. data/test/plugin/test_filter.rb +1 -1
  36. data/test/plugin/test_filter_parser.rb +1 -1
  37. data/test/plugin/test_filter_stdout.rb +2 -2
  38. data/test/plugin/test_in_forward.rb +0 -2
  39. data/test/plugin/test_in_http.rb +23 -0
  40. data/test/plugin/test_in_tail.rb +35 -0
  41. data/test/plugin/test_input.rb +1 -1
  42. data/test/plugin/test_out_exec.rb +6 -4
  43. data/test/plugin/test_out_file.rb +29 -13
  44. data/test/plugin/test_out_stdout.rb +2 -2
  45. data/test/plugin/test_output_as_buffered_retries.rb +53 -6
  46. data/test/plugin/test_output_as_buffered_secondary.rb +2 -2
  47. data/test/plugin_helper/test_retry_state.rb +602 -38
  48. data/test/plugin_helper/test_server.rb +18 -0
  49. data/test/plugin_helper/test_timer.rb +2 -2
  50. data/test/test_event_router.rb +17 -0
  51. data/test/test_formatter.rb +1 -1
  52. data/test/test_supervisor.rb +41 -6
  53. metadata +19 -5
@@ -64,6 +64,24 @@ class ServerPluginHelperTest < Test::Unit::TestCase
64
64
  end
65
65
  assert d.plugin_id
66
66
  assert d.log
67
+ assert_equal 0, d.transport_config.linger_timeout
68
+ end
69
+
70
+ test 'can change linger_timeout option' do
71
+ d = Dummy.new
72
+
73
+ transport_opts = {
74
+ 'linger_timeout' => 1,
75
+ }
76
+ transport_conf = config_element('transport', 'tcp', transport_opts)
77
+ conf = config_element('source', 'tag.*', {}, [transport_conf])
78
+
79
+ assert_nothing_raised do
80
+ d.configure(conf)
81
+ end
82
+ assert d.plugin_id
83
+ assert d.log
84
+ assert_equal 1, d.transport_config.linger_timeout
67
85
  end
68
86
  end
69
87
 
@@ -90,8 +90,8 @@ class TimerTest < Test::Unit::TestCase
90
90
  assert{ counter1 >= 4 && counter1 <= 5 }
91
91
  assert{ counter2 == 2 }
92
92
  msg = "Unexpected error raised. Stopping the timer. title=:t2"
93
- assert{ d1.log.out.logs.any?{|line| line.include?("[error]:") && line.include?(msg) && line.include?("abort!!!!!!") } }
94
- assert{ d1.log.out.logs.any?{|line| line.include?("[error]:") && line.include?("Timer detached. title=:t2") } }
93
+ assert(d1.log.out.logs.any?{|line| line.include?("[error]:") && line.include?(msg) && line.include?("abort!!!!!!") })
94
+ assert(d1.log.out.logs.any?{|line| line.include?("[error]:") && line.include?("Timer detached. title=:t2") })
95
95
 
96
96
  d1.shutdown; d1.close; d1.terminate
97
97
  end
@@ -326,6 +326,23 @@ class EventRouterTest < ::Test::Unit::TestCase
326
326
  event_router.emit('test', Engine.now, 'k' => 'v')
327
327
  end
328
328
  end
329
+
330
+ test 'can pass records modified by filters to handle_emits_error' do
331
+ filter = Class.new(FluentTestFilter) {
332
+ def filter_stream(_tag, es); end
333
+ }.new
334
+ event_router.add_rule('test', filter)
335
+ event_router.add_rule('test', error_output)
336
+
337
+ time = Engine.now
338
+ modified_es = OneEventStream.new(time, 'modified_label' => 'modified_value')
339
+
340
+ assert_rr do
341
+ stub(filter).filter_stream { modified_es }
342
+ mock(emit_handler).handle_emits_error('test', modified_es, is_a(RuntimeError))
343
+ event_router.emit('test', time, 'pre_label' => 'pre_value')
344
+ end
345
+ end
329
346
  end
330
347
  end
331
348
  end
@@ -349,7 +349,7 @@ module FormatterTest
349
349
  include FormatterTest
350
350
 
351
351
  def test_unknown_format
352
- assert_raise ConfigError do
352
+ assert_raise NotFoundPluginError do
353
353
  Fluent::Plugin.new_formatter('unknown')
354
354
  end
355
355
  end
@@ -213,16 +213,22 @@ class SupervisorTest < ::Test::Unit::TestCase
213
213
  $log.out.reset if $log && $log.out && $log.out.respond_to?(:reset)
214
214
  end
215
215
 
216
- def test_rpc_server
216
+ data(:ipv4 => ["0.0.0.0", "127.0.0.1", false],
217
+ :ipv6 => ["[::]", "[::1]", true],
218
+ :localhost_ipv4 => ["localhost", "127.0.0.1", false])
219
+ def test_rpc_server(data)
217
220
  omit "Windows cannot handle signals" if Fluent.windows?
218
221
 
222
+ bindaddr, localhost, ipv6 = data
223
+ omit "IPv6 is not supported on this environment" if ipv6 && !ipv6_enabled?
224
+
219
225
  create_info_dummy_logger
220
226
 
221
227
  opts = Fluent::Supervisor.default_options
222
228
  sv = Fluent::Supervisor.new(opts)
223
229
  conf_data = <<-EOC
224
230
  <system>
225
- rpc_endpoint 0.0.0.0:24447
231
+ rpc_endpoint "#{bindaddr}:24447"
226
232
  </system>
227
233
  EOC
228
234
  conf = Fluent::Config.parse(conf_data, "(test)", "(test_dir)", true)
@@ -235,7 +241,7 @@ class SupervisorTest < ::Test::Unit::TestCase
235
241
  server.run_rpc_server
236
242
 
237
243
  sv.send(:install_main_process_signal_handlers)
238
- response = Net::HTTP.get(URI.parse('http://127.0.0.1:24447/api/plugins.flushBuffers'))
244
+ response = Net::HTTP.get(URI.parse("http://#{localhost}:24447/api/plugins.flushBuffers"))
239
245
  info_msg = '[info]: force flushing buffered events' + "\n"
240
246
 
241
247
  server.stop_rpc_server
@@ -250,16 +256,45 @@ class SupervisorTest < ::Test::Unit::TestCase
250
256
  $log.out.reset if $log.out.is_a?(Fluent::Test::DummyLogDevice)
251
257
  end
252
258
 
253
- def test_rpc_server_windows
259
+ data(:no_port => ["127.0.0.1"],
260
+ :invalid_addr => ["*:24447"])
261
+ def test_invalid_rpc_endpoint(data)
262
+ endpoint = data[0]
263
+
264
+ opts = Fluent::Supervisor.default_options
265
+ sv = Fluent::Supervisor.new(opts)
266
+ conf_data = <<-EOC
267
+ <system>
268
+ rpc_endpoint "#{endpoint}"
269
+ </system>
270
+ EOC
271
+ conf = Fluent::Config.parse(conf_data, "(test)", "(test_dir)", true)
272
+ sys_conf = sv.__send__(:build_system_config, conf)
273
+
274
+ server = DummyServer.new
275
+ server.rpc_endpoint = sys_conf.rpc_endpoint
276
+
277
+ assert_raise(Fluent::ConfigError.new("Invalid rpc_endpoint: #{endpoint}")) do
278
+ server.run_rpc_server
279
+ end
280
+ end
281
+
282
+ data(:ipv4 => ["0.0.0.0", "127.0.0.1", false],
283
+ :ipv6 => ["[::]", "[::1]", true],
284
+ :localhost_ipv4 => ["localhost", "127.0.0.1", true])
285
+ def test_rpc_server_windows(data)
254
286
  omit "Only for windows platform" unless Fluent.windows?
255
287
 
288
+ bindaddr, localhost, ipv6 = data
289
+ omit "IPv6 is not supported on this environment" if ipv6 && !ipv6_enabled?
290
+
256
291
  create_info_dummy_logger
257
292
 
258
293
  opts = Fluent::Supervisor.default_options
259
294
  sv = Fluent::Supervisor.new(opts)
260
295
  conf_data = <<-EOC
261
296
  <system>
262
- rpc_endpoint 0.0.0.0:24447
297
+ rpc_endpoint "#{bindaddr}:24447"
263
298
  </system>
264
299
  EOC
265
300
  conf = Fluent::Config.parse(conf_data, "(test)", "(test_dir)", true)
@@ -277,7 +312,7 @@ class SupervisorTest < ::Test::Unit::TestCase
277
312
  server.run_rpc_server
278
313
 
279
314
  mock(server).restart(true) { nil }
280
- response = Net::HTTP.get(URI.parse('http://127.0.0.1:24447/api/plugins.flushBuffers'))
315
+ response = Net::HTTP.get(URI.parse("http://#{localhost}:24447/api/plugins.flushBuffers"))
281
316
 
282
317
  server.stop_rpc_server
283
318
  assert_equal('{"ok":true}', response)
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.14.3
4
+ version: 1.14.6
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-26 00:00:00.000000000 Z
11
+ date: 2022-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,7 +84,7 @@ dependencies:
84
84
  requirements:
85
85
  - - ">="
86
86
  - !ruby/object:Gem::Version
87
- version: 2.2.2
87
+ version: 2.2.5
88
88
  - - "<"
89
89
  - !ruby/object:Gem::Version
90
90
  version: 3.0.0
@@ -94,7 +94,7 @@ dependencies:
94
94
  requirements:
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
- version: 2.2.2
97
+ version: 2.2.5
98
98
  - - "<"
99
99
  - !ruby/object:Gem::Version
100
100
  version: 3.0.0
@@ -428,6 +428,20 @@ dependencies:
428
428
  - - "<"
429
429
  - !ruby/object:Gem::Version
430
430
  version: '4'
431
+ - !ruby/object:Gem::Dependency
432
+ name: async
433
+ requirement: !ruby/object:Gem::Requirement
434
+ requirements:
435
+ - - "~>"
436
+ - !ruby/object:Gem::Version
437
+ version: '1.23'
438
+ type: :development
439
+ prerelease: false
440
+ version_requirements: !ruby/object:Gem::Requirement
441
+ requirements:
442
+ - - "~>"
443
+ - !ruby/object:Gem::Version
444
+ version: '1.23'
431
445
  - !ruby/object:Gem::Dependency
432
446
  name: async-http
433
447
  requirement: !ruby/object:Gem::Requirement
@@ -1035,7 +1049,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1035
1049
  - !ruby/object:Gem::Version
1036
1050
  version: '0'
1037
1051
  requirements: []
1038
- rubygems_version: 3.1.6
1052
+ rubygems_version: 3.3.7
1039
1053
  signing_key:
1040
1054
  specification_version: 4
1041
1055
  summary: Fluentd event collector