fluentd 1.2.4 → 1.2.5.rc1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 17c2e18def2c549e14b7f5bd986553c3b2794047226b50ad396de592b94b292d
4
- data.tar.gz: 305e459a87099290266c984d8c8c11634a0312cf17eae3fdd71456d586ef8f94
2
+ SHA1:
3
+ metadata.gz: 3f29e9a39ff3f4da51cf0444ce29cda70e415774
4
+ data.tar.gz: 817b03453278294de0dbaa7169cd9236c5748dab
5
5
  SHA512:
6
- metadata.gz: e494dd2f456187adfbc860f89352c51b9b33532fd911e0c8a5eeb71859fe450bd42c62db29332daed2581e80ec9faa45d6b3f842d39606121886739cdb181b51
7
- data.tar.gz: 98d885f434fb9c0534db4095e39869635477aed6c1236a219a41cb5b094e40e62f418f0cbab420dc7be6910e4cf0d7979601834fc2828bc149f29addd6f1b758
6
+ metadata.gz: 1f56c92cbf33ce381aa4da673c2230853678ab61dbb13b9996c1d81c42daf024644a1f207ea8fdee5e4dc4454517adeee549755d1cb77e38c6b3134e99cf8581
7
+ data.tar.gz: 97e3f8825d7b46527609bad69d1b06c1a7ae4af8719d0c8c54222b92e335eb1c7021848f90dc05acf06abde63a01bb4362cdcdad9d39a4a720cd0f5f8ba0fea0
@@ -35,10 +35,10 @@ After 6 months a maintainer will be made an "owner" of the GitHub organization.
35
35
 
36
36
  ## Projects
37
37
 
38
- The fluent organization is open to receive new sub-projects under it umbrella. To apply a project as part of the __fluent__ organization, it have to met the following criteria:
38
+ The fluent organization is open to receive new sub-projects under it umbrella. To apply a project as part of the __fluent__ organization, it has to met the following criteria:
39
39
 
40
40
  - Licensed under the terms of the Apache License v2.0
41
- - Project have been active for at least one year since it inception
41
+ - Project has been active for at least one year since it inception
42
42
  - More than 2 contributors
43
43
  - Related to one or more scopes of Fluentd ecosystem:
44
44
  - Data collection
@@ -41,7 +41,7 @@ module Fluent
41
41
  # from plugins which DOES emit, then DOESN'T emit
42
42
  # (input -> output w/ router -> filter -> output w/o router)
43
43
  # for start: use this order DESC
44
- # (because plugins which appears later in configurations will receive events from plugins which appears ealier)
44
+ # (because plugins which appears later in configurations will receive events from plugins which appears earlier)
45
45
  # for stop/before_shutdown/shutdown/after_shutdown/close/terminate: use this order ASC
46
46
  @lifecycle_cache = nil
47
47
 
@@ -177,7 +177,7 @@ if Fluent.windows?
177
177
  opts[:regwinsvcautostart] = s
178
178
  }
179
179
 
180
- op.on('--reg-winsvc-fluentdopt OPTION', "specify fluentd option paramters for Windows Service. (Windows only)") {|s|
180
+ op.on('--reg-winsvc-fluentdopt OPTION', "specify fluentd option parameters for Windows Service. (Windows only)") {|s|
181
181
  opts[:fluentdopt] = s
182
182
  }
183
183
 
@@ -198,7 +198,7 @@ EOM
198
198
 
199
199
  def scan_json(is_array)
200
200
  result = nil
201
- # Yajl does not raise ParseError for imcomplete json string, like '[1', '{"h"', '{"h":' or '{"h1":1'
201
+ # Yajl does not raise ParseError for incomplete json string, like '[1', '{"h"', '{"h":' or '{"h1":1'
202
202
  # This is the reason to use JSON module.
203
203
 
204
204
  buffer = (is_array ? "[" : "{")
@@ -217,7 +217,7 @@ module Fluent
217
217
  @optimizable = if fs_filters.empty?
218
218
  true
219
219
  else
220
- # skip log message when filter is only 1, because its performace is same as non optimized chain.
220
+ # skip log message when filter is only 1, because its performance is same as non optimized chain.
221
221
  if @filters.size > 1 && fs_filters.size >= 1
222
222
  $log.info "disable filter chain optimization because #{fs_filters.map(&:class)} uses `#filter_stream` method."
223
223
  end
@@ -266,13 +266,16 @@ module Fluent::Plugin
266
266
  line_buffer_timer_flusher = (@multiline_mode && @multiline_flush_interval) ? TailWatcher::LineBufferTimerFlusher.new(log, @multiline_flush_interval, &method(:flush_buffer)) : nil
267
267
  tw = TailWatcher.new(path, @rotate_wait, pe, log, @read_from_head, @enable_watch_timer, @enable_stat_watcher, @read_lines_limit, method(:update_watcher), line_buffer_timer_flusher, @from_encoding, @encoding, open_on_every_update, &method(:receive_lines))
268
268
  tw.attach do |watcher|
269
- watcher.timer_trigger = timer_execute(:in_tail_timer_trigger, 1, &watcher.method(:on_notify)) if watcher.enable_watch_timer
270
- event_loop_attach(watcher.stat_trigger) if watcher.enable_stat_watcher
269
+ event_loop_attach(watcher.timer_trigger) if watcher.timer_trigger
270
+ event_loop_attach(watcher.stat_trigger) if watcher.stat_trigger
271
271
  end
272
272
  tw
273
273
  rescue => e
274
274
  if tw
275
- tw.detach
275
+ tw.detach { |watcher|
276
+ event_loop_detach(watcher.timer_trigger) if watcher.timer_trigger
277
+ event_loop_detach(watcher.stat_trigger) if watcher.stat_trigger
278
+ }
276
279
  tw.close
277
280
  end
278
281
  raise e
@@ -343,7 +346,10 @@ module Fluent::Plugin
343
346
  # so adding close_io argument to avoid this problem.
344
347
  # At shutdown, IOHandler's io will be released automatically after detached the event loop
345
348
  def detach_watcher(tw, close_io = true)
346
- tw.detach
349
+ tw.detach { |watcher|
350
+ event_loop_detach(watcher.timer_trigger) if watcher.timer_trigger
351
+ event_loop_detach(watcher.stat_trigger) if watcher.stat_trigger
352
+ }
347
353
  tw.close if close_io
348
354
  flush_buffer(tw)
349
355
  if tw.unwatched && @pf
@@ -352,6 +358,8 @@ module Fluent::Plugin
352
358
  end
353
359
 
354
360
  def detach_watcher_after_rotate_wait(tw)
361
+ # Call event_loop_attach/event_loop_detach is high-cost for short-live object.
362
+ # If this has a problem with large number of files, use @_event_loop directly instead of timer_execute.
355
363
  timer_execute(:in_tail_close_watcher, @rotate_wait, repeat: false) do
356
364
  detach_watcher(tw)
357
365
  end
@@ -479,7 +487,7 @@ module Fluent::Plugin
479
487
  @update_watcher = update_watcher
480
488
 
481
489
  @stat_trigger = @enable_stat_watcher ? StatWatcher.new(self, &method(:on_notify)) : nil
482
- @timer_trigger = nil
490
+ @timer_trigger = @enable_watch_timer ? TimerTrigger.new(1, log, &method(:on_notify)) : nil
483
491
 
484
492
  @rotate_handler = RotateHandler.new(self, &method(:on_rotate))
485
493
  @io_handler = nil
@@ -513,8 +521,7 @@ module Fluent::Plugin
513
521
  end
514
522
 
515
523
  def detach
516
- @timer_trigger.detach if @enable_watch_timer && @timer_trigger && @timer_trigger.attached?
517
- @stat_trigger.detach if @enable_stat_watcher && @stat_trigger && @stat_trigger.attached?
524
+ yield self
518
525
  @io_handler.on_notify if @io_handler
519
526
  end
520
527
 
@@ -613,6 +620,21 @@ module Fluent::Plugin
613
620
  pe # This pe will be updated in on_rotate after TailWatcher is initialized
614
621
  end
615
622
 
623
+ class TimerTrigger < Coolio::TimerWatcher
624
+ def initialize(interval, log, &callback)
625
+ @callback = callback
626
+ @log = log
627
+ super(interval, true)
628
+ end
629
+
630
+ def on_timer
631
+ @callback.call
632
+ rescue => e
633
+ @log.error e.to_s
634
+ @log.error_backtrace
635
+ end
636
+ end
637
+
616
638
  class StatWatcher < Coolio::StatWatcher
617
639
  def initialize(watcher, &callback)
618
640
  @watcher = watcher
@@ -629,7 +651,6 @@ module Fluent::Plugin
629
651
  end
630
652
  end
631
653
 
632
-
633
654
  class FIFO
634
655
  def initialize(from_encoding, encoding)
635
656
  @from_encoding = from_encoding
@@ -442,7 +442,7 @@ module Fluent::Plugin
442
442
  res = unpacker.read
443
443
  log.trace "getting response from destination", host: info.node.host, port: info.node.port, chunk_id: dump_unique_id_hex(info.chunk_id), response: res
444
444
  if res['ack'] != info.chunk_id_base64
445
- # Some errors may have occured when ack and chunk id is different, so send the chunk again.
445
+ # Some errors may have occurred when ack and chunk id is different, so send the chunk again.
446
446
  log.warn "ack in response and chunk id in sent data are different", chunk_id: dump_unique_id_hex(info.chunk_id), ack: res['ack']
447
447
  rollback_write(info.chunk_id, update_retry: false)
448
448
  return nil
@@ -92,8 +92,8 @@ module Fluent
92
92
  # k: times
93
93
  # total retry time: c + c * b^1 + (...) + c*b^k = c*b^(k+1) - 1
94
94
  config_param :retry_wait, :time, default: 1, desc: 'Seconds to wait before next retry to flush, or constant factor of exponential backoff.'
95
- config_param :retry_exponential_backoff_base, :float, default: 2, desc: 'The base number of exponencial backoff for retries.'
96
- config_param :retry_max_interval, :time, default: nil, desc: 'The maximum interval seconds for exponencial backoff between retries while failing.'
95
+ config_param :retry_exponential_backoff_base, :float, default: 2, desc: 'The base number of exponential backoff for retries.'
96
+ config_param :retry_max_interval, :time, default: nil, desc: 'The maximum interval seconds for exponential backoff between retries while failing.'
97
97
 
98
98
  config_param :retry_randomize, :bool, default: true, desc: 'If true, output plugin will retry after randomized interval not to do burst retries.'
99
99
  end
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Fluent
18
18
 
19
- VERSION = '1.2.4'
19
+ VERSION = '1.2.5.rc1'
20
20
 
21
21
  end
@@ -374,7 +374,7 @@ module Fluent::Config
374
374
  </elem2>
375
375
  ]
376
376
  write_config "#{TMP_DIR}/dir/config_test_9.conf", %[
377
- k9 embeded
377
+ k9 embedded
378
378
  <elem3 name>
379
379
  nested nested_value
380
380
  include hoge
@@ -418,7 +418,7 @@ module Fluent::Config
418
418
  elem2 = c.elements.find { |e| e.name == 'elem2' }
419
419
  assert(elem2)
420
420
  assert_equal('name', elem2.arg)
421
- assert_equal('embeded', elem2['k9'])
421
+ assert_equal('embedded', elem2['k9'])
422
422
  assert_not_include(elem2, 'include')
423
423
 
424
424
  elem3 = elem2.elements.find { |e| e.name == 'elem3' }
@@ -1032,12 +1032,12 @@ module Fluent::Config
1032
1032
  detail_base = base.class.merged_configure_proxy.sections[:detail]
1033
1033
  detail_sub = sub.class.merged_configure_proxy.sections[:detail]
1034
1034
  detail_base_attributes = {
1035
- requried: detail_base.required,
1035
+ required: detail_base.required,
1036
1036
  multi: detail_base.multi,
1037
1037
  alias: detail_base.alias,
1038
1038
  }
1039
1039
  detail_sub_attributes = {
1040
- requried: detail_sub.required,
1040
+ required: detail_sub.required,
1041
1041
  multi: detail_sub.multi,
1042
1042
  alias: detail_sub.alias,
1043
1043
  }
@@ -44,7 +44,7 @@ def prepare_config1
44
44
  </elem2>
45
45
  ]
46
46
  write_config "#{TMP_DIR}/dir/config_test_9.conf", %[
47
- k9 embeded
47
+ k9 embedded
48
48
  <elem3 name>
49
49
  nested nested_value
50
50
  include hoge
@@ -262,7 +262,7 @@ module Fluent::Config
262
262
  elem2 = @root.elements.find { |e| e.name == 'elem2' }
263
263
  assert(elem2)
264
264
  assert_equal('name', elem2.arg)
265
- assert_equal('embeded', elem2['k9'])
265
+ assert_equal('embedded', elem2['k9'])
266
266
  assert_not_include(elem2, 'include')
267
267
 
268
268
  elem3 = elem2.elements.find { |e| e.name == 'elem3' }
@@ -7,7 +7,7 @@ require 'fluent/system_config'
7
7
  module Fluent::Config
8
8
  class FakeLoggerInitializer
9
9
  attr_accessor :level
10
- def initalize
10
+ def initialize
11
11
  @level = nil
12
12
  end
13
13
  end
@@ -49,7 +49,7 @@ EOS
49
49
 
50
50
  data('resolve_hostname' => 'resolve_hostname true',
51
51
  'source_hostname_key' => 'source_hostname_key source_host')
52
- def test_configure_reslove_hostname(param)
52
+ def test_configure_resolve_hostname(param)
53
53
  d = create_driver([CONFIG, param].join("\n"))
54
54
  assert_true d.instance.resolve_hostname
55
55
  end
@@ -969,7 +969,7 @@ class TailInputTest < Test::Unit::TestCase
969
969
  end
970
970
 
971
971
  # For https://github.com/fluent/fluentd/issues/1455
972
- # This test is fragile because test content depends on internal implementaion.
972
+ # This test is fragile because test content depends on internal implementation.
973
973
  # So if you modify in_tail internal, this test may break.
974
974
  def test_unwatched_files_should_be_removed
975
975
  config = config_element("", "", {
@@ -990,7 +990,7 @@ class TailInputTest < Test::Unit::TestCase
990
990
  waiting(20) { sleep 0.1 until Dir.glob("#{TMP_DIR}/*.txt").size == 0 } # Ensure file is deleted on Windows
991
991
  waiting(5) { sleep 0.1 until d.instance.instance_variable_get(:@tails).keys.size == 0 }
992
992
 
993
- # Previous implementaion has an infinite watcher creation bug.
993
+ # Previous implementation has an infinite watcher creation bug.
994
994
  # Following code checks such unexpected bug by couting actual object allocation.
995
995
  base_num = count_timer_object
996
996
  2.times {
@@ -53,7 +53,7 @@ class ConfigTest < Test::Unit::TestCase
53
53
  </elem2>
54
54
  ]
55
55
  write_config "#{TMP_DIR}/dir/config_test_9.conf", %[
56
- k9 embeded
56
+ k9 embedded
57
57
  <elem3 name>
58
58
  nested nested_value
59
59
  include hoge
@@ -98,7 +98,7 @@ class ConfigTest < Test::Unit::TestCase
98
98
  elem2 = c.elements.find { |e| e.name == 'elem2' }
99
99
  assert_not_nil elem2
100
100
  assert_equal 'name', elem2.arg
101
- assert_equal 'embeded', elem2['k9']
101
+ assert_equal 'embedded', elem2['k9']
102
102
  assert !elem2.has_key?('include')
103
103
 
104
104
  elem3 = elem2.elements.find { |e| e.name == 'elem3' }
@@ -145,7 +145,7 @@ class ConfigTest < Test::Unit::TestCase
145
145
  not_fetched = []; rule_conf.check_not_fetched {|key, e| not_fetched << key }
146
146
  assert_equal %w[pattern replace], not_fetched
147
147
 
148
- # repeateadly accessing should not grow memory usage
148
+ # repeatedly accessing should not grow memory usage
149
149
  before_size = match_conf.unused.size
150
150
  10.times { match_conf['type'] }
151
151
  assert_equal before_size, match_conf.unused.size
@@ -493,7 +493,7 @@ class LogTest < Test::Unit::TestCase
493
493
  end
494
494
  end
495
495
 
496
- def test_log_rotates_specifed_size_with_logdevio
496
+ def test_log_rotates_specified_size_with_logdevio
497
497
  with_timezone('utc') do
498
498
  rotate_age = 2
499
499
  rotate_size = 100
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.2.4
4
+ version: 1.2.5.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-02 00:00:00.000000000 Z
11
+ date: 2018-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -764,12 +764,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
764
764
  version: '2.1'
765
765
  required_rubygems_version: !ruby/object:Gem::Requirement
766
766
  requirements:
767
- - - ">="
767
+ - - ">"
768
768
  - !ruby/object:Gem::Version
769
- version: '0'
769
+ version: 1.3.1
770
770
  requirements: []
771
771
  rubyforge_project:
772
- rubygems_version: 2.7.6
772
+ rubygems_version: 2.6.14.1
773
773
  signing_key:
774
774
  specification_version: 4
775
775
  summary: Fluentd event collector