fluentd 0.14.15 → 0.14.16

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
2
  SHA1:
3
- metadata.gz: 3f2a4f15bf32737020c69883079694ad81648cff
4
- data.tar.gz: 142851ddfb0483e49bc1b71aed6e7e98db295c34
3
+ metadata.gz: c8ecd747594db63d79cc18e76b0c79869d3d5388
4
+ data.tar.gz: 8b70682f2c2ce355b8f84aeba9898142abe29d95
5
5
  SHA512:
6
- metadata.gz: ad5bcad4d26b4cfaa59b7b59c5100cfe0a651206dbadfb0b519369f8b095951bf68f45c8df67dd6954bdb8fc64a714cd4911063f9c5eebb9d963ebd7dd71af4f
7
- data.tar.gz: c38a2498db6ea742f50103beca1e9c4f8e19fd1f811e84152a2d7679d0225edb65f1cb7e75975f414ec0ea5343a4ca2f2342f233b55bcd4969bfcf481260ec26
6
+ metadata.gz: d6ce26c60893a685559442d5aad416fcf4535ceb3324ab359518f70b9cc9ac9582ee53fb5b6fcceff0e0d1db70049afa5370ec90ee69f86f2b8881e4fdeb2aef
7
+ data.tar.gz: 34bc0fb042d7f97bbfc6bf7e39e0ae673eb09ec49eb8456483688b677fb086dbeef8fdf2a6d01d1685c4ab25ac49f65d1eaadda7dea3cc12dfebc657d373e476
@@ -13,13 +13,13 @@ matrix:
13
13
  os: linux
14
14
  - rvm: 2.3.3
15
15
  os: linux
16
- - rvm: 2.4.0
16
+ - rvm: 2.4.1
17
17
  os: linux
18
18
  - rvm: ruby-head
19
19
  os: linux
20
20
  - rvm: 2.1.10
21
21
  os: osx
22
- osx_image: xcode8.2 # OSX 10.12
22
+ osx_image: xcode8.3 # OSX 10.12
23
23
  # - rvm: 2.2.6
24
24
  # os: osx
25
25
  # osx_image: xcode8.2 # OSX 10.12
@@ -28,17 +28,16 @@ matrix:
28
28
  # osx_image: xcode8.2 # OSX 10.12
29
29
  - rvm: 2.4.0
30
30
  os: osx
31
- osx_image: xcode8.2 # OSX 10.12
31
+ osx_image: xcode8.3 # OSX 10.12
32
32
  - rvm: ruby-head
33
33
  os: osx
34
- osx_image: xcode 8.2 # OSX 10.12
34
+ osx_image: xcode 8.3 # OSX 10.12
35
35
  allow_failures:
36
36
  - rvm: ruby-head
37
37
 
38
38
  branches:
39
39
  only:
40
40
  - master
41
- - v0.10
42
41
  - v0.12
43
42
  - v0.14
44
43
 
data/ChangeLog CHANGED
@@ -1,5 +1,25 @@
1
1
  # v0.14
2
2
 
3
+ ## Release v0.14.16 - 2017/05/13
4
+
5
+ ### New features / Enhancements
6
+
7
+ * config: Allow null byte in double-quoted string
8
+ https://github.com/fluent/fluentd/pull/1552
9
+ * parser: Support %iso8601 special case for time_format
10
+ https://github.com/fluent/fluentd/pull/1562
11
+
12
+ ### Bug fixes
13
+
14
+ * out_forward: Call proper method for each connection type
15
+ https://github.com/fluent/fluentd/pull/1560
16
+ * in_monitor_agent: check variable buffer is a Buffer instance
17
+ https://github.com/fluent/fluentd/pull/1556
18
+ * log: Add missing '<<' method to delegators
19
+ https://github.com/fluent/fluentd/pull/1558
20
+ * command: uninitialized constant Fluent::Engine in fluent-binlog-reader
21
+ https://github.com/fluent/fluentd/pull/1568
22
+
3
23
  ## Release v0.14.15 - 2017/04/23
4
24
 
5
25
  ### New features / Enhancements
@@ -0,0 +1,5 @@
1
+ - Sadayuki Furuhashi <frsyuki@gmail.com>
2
+ - Masahiro Nakagawa <repeatedly@gmail.com>
3
+ - Kiyoto Tamura <me@ktamura.com>
4
+ - Kazuki Ohta <kazuki.ohta@gmail.com>
5
+ - Satoshi "Moris" Tagomori <tagomoris@gmail.com>
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
21
21
 
22
22
  gem.add_runtime_dependency("msgpack", [">= 0.7.0", "< 2.0.0"])
23
23
  gem.add_runtime_dependency("yajl-ruby", ["~> 1.0"])
24
- gem.add_runtime_dependency("cool.io", ["~> 1.4.5"])
24
+ gem.add_runtime_dependency("cool.io", [">= 1.4.5", "< 2.0.0"])
25
25
  gem.add_runtime_dependency("serverengine", [">= 2.0.4", "< 3.0.0"])
26
26
  gem.add_runtime_dependency("http_parser.rb", [">= 0.5.1", "< 0.7.0"])
27
27
  gem.add_runtime_dependency("sigdump", ["~> 0.2.2"])
@@ -21,6 +21,7 @@ require 'fluent/msgpack_factory'
21
21
  require 'fluent/formatter'
22
22
  require 'fluent/plugin'
23
23
  require 'fluent/config/element'
24
+ require 'fluent/engine'
24
25
 
25
26
  class FluentBinlogReader
26
27
  SUBCOMMAND = %w(cat head formats)
@@ -181,6 +181,8 @@ module Fluent
181
181
  "\f"
182
182
  when "b"
183
183
  "\b"
184
+ when "0"
185
+ "\0"
184
186
  when /[a-zA-Z0-9]/
185
187
  parse_error! "unexpected back-slash escape character '#{c}'"
186
188
  else # symbols
@@ -472,7 +472,7 @@ module Fluent
472
472
  extend Forwardable
473
473
  def_delegators '@logger', :enable_color?, :enable_debug, :enable_event,
474
474
  :disable_events, :log_event_enabled, :log_event_enamed=, :time_format, :time_format=,
475
- :event, :caller_line, :puts, :write, :flush, :reset, :out, :out=,
475
+ :event, :caller_line, :puts, :write, :<<, :flush, :reset, :out, :out=,
476
476
  :optional_header, :optional_header=, :optional_attrs, :optional_attrs=
477
477
  end
478
478
 
@@ -211,7 +211,7 @@ module Fluent::Plugin
211
211
  options = on_message(msg, chunk_size, conn)
212
212
  if options && r = response(options)
213
213
  log.trace "sent response to fluent socket", address: conn.remote_addr, response: r
214
- conn.on_write_complete{ conn.close } if @deny_keepalive
214
+ conn.on(:write_complete) { |c| c.close } if @deny_keepalive
215
215
  send_data.call(serializer, r)
216
216
  else
217
217
  if @deny_keepalive
@@ -278,8 +278,8 @@ module Fluent::Plugin
278
278
 
279
279
  MONITOR_INFO = {
280
280
  'output_plugin' => ->(){ is_a?(::Fluent::Plugin::Output) },
281
- 'buffer_queue_length' => ->(){ throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil?; @buffer.queue.size },
282
- 'buffer_total_queued_size' => ->(){ throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil?; @buffer.stage_size },
281
+ 'buffer_queue_length' => ->(){ throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil? && @buffer.is_a?(::Fluent::Plugin::Buffer); @buffer.queue.size },
282
+ 'buffer_total_queued_size' => ->(){ throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil? && @buffer.is_a?(::Fluent::Plugin::Buffer); @buffer.stage_size },
283
283
  'retry_count' => ->(){ instance_variable_defined?(:@num_errors) ? @num_errors : nil },
284
284
  }
285
285
 
@@ -420,7 +420,7 @@ module Fluent::Plugin
420
420
  # return chunk id to be committed
421
421
  def read_ack_from_sock(sock, unpacker)
422
422
  begin
423
- raw_data = sock.recv(@read_length)
423
+ raw_data = sock.instance_of?(Fluent::PluginHelper::Socket::WrappedSocket::TLS) ? sock.readpartial(@read_length) : sock.recv(@read_length)
424
424
  rescue Errno::ECONNRESET
425
425
  raw_data = ""
426
426
  end
@@ -208,6 +208,7 @@ module Fluent
208
208
  @parse = case
209
209
  when format_with_timezone && strptime then ->(v){ Fluent::EventTime.from_time(strptime.exec(v)) }
210
210
  when format_with_timezone then ->(v){ Fluent::EventTime.from_time(Time.strptime(v, format)) }
211
+ when format == '%iso8601' then ->(v){ Fluent::EventTime.from_time(Time.iso8601(v)) }
211
212
  when strptime then ->(v){ t = strptime.exec(v); Fluent::EventTime.new(t.to_i + offset_diff, t.nsec) }
212
213
  when format then ->(v){ t = Time.strptime(v, format); Fluent::EventTime.new(t.to_i + offset_diff, t.nsec) }
213
214
  else ->(v){ Fluent::EventTime.parse(v) }
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Fluent
18
18
 
19
- VERSION = '0.14.15'
19
+ VERSION = '0.14.16'
20
20
 
21
21
  end
@@ -105,8 +105,8 @@ module Fluent::Config
105
105
  test('"\\.t"') { assert_text_parsed_as(".t", '"\\.t"') }
106
106
  test('"\\$t"') { assert_text_parsed_as("$t", '"\\$t"') }
107
107
  test('"\\"') { assert_text_parsed_as("#t", '"\\#t"') }
108
+ test('"\\0"') { assert_text_parsed_as("\0", '"\\0"') }
108
109
  test('"\\z"') { assert_parse_error('"\\z"') } # unknown escaped character
109
- test('"\\0"') { assert_parse_error('"\\0"') } # unknown escaped character
110
110
  test('"\\1"') { assert_parse_error('"\\1"') } # unknown escaped character
111
111
  test('"t') { assert_parse_error('"t') } # non-terminated quoted character
112
112
  test("\"t\nt\"") { assert_text_parsed_as("t\nt", "\"t\nt\"" ) } # multiline string
@@ -513,4 +513,58 @@ plugin_id:test_filter\tplugin_category:filter\ttype:test_filter\toutput_plugin:f
513
513
  assert_equal("200", get("http://127.0.0.1:#{port}/api/plugins").code)
514
514
  end
515
515
  end
516
+
517
+ sub_test_case "check NoMethodError does not happen" do
518
+ class FluentTestBufferVariableOutput < ::Fluent::Plugin::Output
519
+ ::Fluent::Plugin.register_output('test_out_buffer_variable', self)
520
+ def configure(conf)
521
+ super
522
+ @buffer = []
523
+ end
524
+
525
+ def write(chunk)
526
+ end
527
+ end
528
+ class FluentTestBufferVariableFilter < ::Fluent::Plugin::Filter
529
+ ::Fluent::Plugin.register_filter("test_filter_buffer_variable", self)
530
+ def initialize
531
+ super
532
+ @buffer = {}
533
+ end
534
+ def filter(tag, time, record)
535
+ record
536
+ end
537
+ end
538
+
539
+ setup do
540
+ conf = <<-EOC
541
+ <match **>
542
+ @type test_out_buffer_variable
543
+ @id test_out_buffer_variable
544
+ </match>
545
+ <filter **>
546
+ @type test_filter_buffer_variable
547
+ @id test_filter_buffer_variable
548
+ </filter>
549
+ EOC
550
+ @ra = Fluent::RootAgent.new(log: $log)
551
+ stub(Fluent::Engine).root_agent { @ra }
552
+ @ra = configure_ra(@ra, conf)
553
+ end
554
+
555
+ test "plugins have a variable named buffer does not throws NoMethodError" do
556
+ port = unused_port
557
+ d = create_driver("
558
+ @type monitor_agent
559
+ bind '127.0.0.1'
560
+ port #{port}
561
+ include_config no
562
+ ")
563
+ d.instance.start
564
+
565
+ assert_equal("200", get("http://127.0.0.1:#{port}/api/plugins.json").code)
566
+ assert{ d.logs.none?{|log| log.include?("NoMethodError") } }
567
+ assert_equal(false, d.instance.instance_variable_get(:@first_warn))
568
+ end
569
+ end
516
570
  end
@@ -430,6 +430,51 @@ EOL
430
430
  assert_empty d.instance.exceptions
431
431
  end
432
432
 
433
+ data('ack true' => true,
434
+ 'ack false' => false)
435
+ test 'TLS transport and ack parameter combination' do |ack|
436
+ omit "TLS and 'ack false' always fails on AppVeyor. Need to debug" if Fluent.windows? && !ack
437
+
438
+ input_conf = TARGET_CONFIG + %[
439
+ <transport tls>
440
+ insecure true
441
+ </transport>
442
+ ]
443
+ target_input_driver = create_target_input_driver(conf: input_conf)
444
+
445
+ output_conf = %[
446
+ send_timeout 5
447
+ require_ack_response #{ack}
448
+ transport tls
449
+ tls_insecure_mode true
450
+ <server>
451
+ host #{TARGET_HOST}
452
+ port #{TARGET_PORT}
453
+ </server>
454
+ <buffer>
455
+ #flush_mode immediate
456
+ flush_interval 0s
457
+ flush_at_shutdown false # suppress errors in d.instance_shutdown
458
+ </buffer>
459
+ ]
460
+ @d = d = create_driver(output_conf)
461
+
462
+ time = event_time("2011-01-02 13:14:15 UTC")
463
+ records = [{"a" => 1}, {"a" => 2}]
464
+ target_input_driver.run(expect_records: 2, timeout: 3) do
465
+ d.run(default_tag: 'test', wait_flush_completion: false, shutdown: false) do
466
+ records.each do |record|
467
+ d.feed(time, record)
468
+ end
469
+ end
470
+ end
471
+
472
+ events = target_input_driver.events
473
+ assert{ events != [] }
474
+ assert_equal(['test', time, records[0]], events[0])
475
+ assert_equal(['test', time, records[1]], events[1])
476
+ end
477
+
433
478
  test 'a destination node not supporting responses by just ignoring' do
434
479
  target_input_driver = create_target_input_driver(response_stub: ->(_option) { nil }, disconnect: false)
435
480
 
@@ -722,6 +722,8 @@ class PluginLoggerTest < Test::Unit::TestCase
722
722
 
723
723
  def test_write_alias
724
724
  assert(@log.respond_to?(:<<))
725
+ mock(@log.out).write("log")
726
+ @log << "log"
725
727
  end
726
728
 
727
729
  def test_out
@@ -34,6 +34,18 @@ class TimeParserTest < ::Test::Unit::TestCase
34
34
  assert_equal_event_time(time, parser.parse('28/Feb/2013:12:00:00:123456789 +0900'))
35
35
  end
36
36
 
37
+ def test_parse_iso8601
38
+ parser = Fluent::TimeParser.new('%iso8601')
39
+
40
+ assert(parser.parse('2017-01-01T12:00:00+09:00').is_a?(Fluent::EventTime))
41
+
42
+ time = event_time('2017-01-01T12:00:00+09:00')
43
+ assert_equal(time, parser.parse('2017-01-01T12:00:00+09:00'))
44
+
45
+ time_with_msec = event_time('2017-01-01T12:00:00.123+09:00')
46
+ assert_equal(time_with_msec, parser.parse('2017-01-01T12:00:00.123+09:00'))
47
+ end
48
+
37
49
  def test_parse_with_invalid_argument
38
50
  parser = Fluent::TimeParser.new
39
51
 
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: 0.14.15
4
+ version: 0.14.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-24 00:00:00.000000000 Z
11
+ date: 2017-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -48,16 +48,22 @@ dependencies:
48
48
  name: cool.io
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: 1.4.5
54
+ - - "<"
55
+ - !ruby/object:Gem::Version
56
+ version: 2.0.0
54
57
  type: :runtime
55
58
  prerelease: false
56
59
  version_requirements: !ruby/object:Gem::Requirement
57
60
  requirements:
58
- - - "~>"
61
+ - - ">="
59
62
  - !ruby/object:Gem::Version
60
63
  version: 1.4.5
64
+ - - "<"
65
+ - !ruby/object:Gem::Version
66
+ version: 2.0.0
61
67
  - !ruby/object:Gem::Dependency
62
68
  name: serverengine
63
69
  requirement: !ruby/object:Gem::Requirement
@@ -303,6 +309,7 @@ files:
303
309
  - COPYING
304
310
  - ChangeLog
305
311
  - Gemfile
312
+ - MAINTAINERS.md
306
313
  - README.md
307
314
  - Rakefile
308
315
  - Vagrantfile