fluentd 1.5.1 → 1.5.2

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
  SHA256:
3
- metadata.gz: cc00110d00a473f82be35d411b2efcad974613e6ac16db59538840bced53ce02
4
- data.tar.gz: 4bcb347f931027fabff0516c589a6b439763a0f36e38c3707213955f8b2fce2b
3
+ metadata.gz: 8e5e328bed0abe290a9ae9b9f4b84fc725064340f4b440e346eaa353dff653f8
4
+ data.tar.gz: b61c74d2c260da91d2141d261db4787448677e1926c63e3a5b08f5d5f98cfc82
5
5
  SHA512:
6
- metadata.gz: 9eaf4fab8332a2ba7d172b6d63ed08eecab23f5bdcdbc56fe557b3a888bf155e3eb404bfa0a583dc3483fdee5ab5a415f8e63157379073299815c194bf45f2b3
7
- data.tar.gz: be56a1d495a143a136a716f0b9142dfcc22d0c4ed88bd188ad0bc90e8253444eb47e70f6f7d4274855feb47c45f051ebd01fd399fbc046ab2d18ca8a9e321140
6
+ metadata.gz: af15e7b57e2bde74c846e71f768e7293901e68b4fc1d3a6d6a2620874d43df272611a44337b40437ec1307d2964cec5b7f057ac7c7451a2f89f1e74a8b40d679
7
+ data.tar.gz: b4a0e4c283faf5f8ff2144ad337a5993a99c0bfc2e4eae43dbad9b234d0f6a03420fcb4a149151effdc1976b507760eb453b754ced5ff4c6b8f323d4c9d3afad
@@ -1,5 +1,12 @@
1
1
  # v1.5
2
2
 
3
+ ## Release v1.5.2 - 2019/06/13
4
+
5
+ ### Bug fixes
6
+
7
+ * out_forward: Fix duplicated handshake bug in keepalive
8
+ https://github.com/fluent/fluentd/pull/2456
9
+
3
10
  ## Release v1.5.1 - 2019/06/05
4
11
 
5
12
  ### Enhancement
@@ -770,8 +770,7 @@ module Fluent::Plugin
770
770
  end
771
771
 
772
772
  def verify_connection
773
- connect do |sock|
774
- ri = RequestInfo.new(@sender.security ? :helo : :established)
773
+ connect do |sock, ri|
775
774
  if ri.state != :established
776
775
  establish_connection(sock, ri)
777
776
  raise if ri.state != :established
@@ -810,11 +809,6 @@ module Fluent::Plugin
810
809
  end
811
810
 
812
811
  def send_data_actual(sock, tag, chunk)
813
- ri = RequestInfo.new(@sender.security ? :helo : :established)
814
- if ri.state != :established
815
- establish_connection(sock, ri)
816
- end
817
-
818
812
  unless available?
819
813
  raise ConnectionClosedError, "failed to establish connection with node #{@name}"
820
814
  end
@@ -841,7 +835,10 @@ module Fluent::Plugin
841
835
  end
842
836
 
843
837
  def send_data(tag, chunk)
844
- sock = connect
838
+ sock, ri = connect
839
+ if ri.state != :established
840
+ establish_connection(sock, ri)
841
+ end
845
842
 
846
843
  begin
847
844
  send_data_actual(sock, tag, chunk)
@@ -1073,26 +1070,36 @@ module Fluent::Plugin
1073
1070
  private
1074
1071
 
1075
1072
  def connect(host = nil)
1076
- sock = if @keepalive
1077
- @socket_cache.fetch_or { @sender.create_transfer_socket(host || resolved_host, port, @hostname) }
1078
- else
1079
- @log.debug('connect new socket')
1080
- @sender.create_transfer_socket(host || resolved_host, port, @hostname)
1081
- end
1073
+ socket, request_info =
1074
+ if @keepalive
1075
+ ri = RequestInfo.new(:established)
1076
+ sock = @socket_cache.fetch_or do
1077
+ s = @sender.create_transfer_socket(host || resolved_host, port, @hostname)
1078
+ ri = RequestInfo.new(@sender.security ? :helo : :established) # overwrite if new connection
1079
+ s
1080
+ end
1081
+ [sock, ri]
1082
+ else
1083
+ @log.debug('connect new socket')
1084
+ [@sender.create_transfer_socket(host || resolved_host, port, @hostname), RequestInfo.new(@sender.security ? :helo : :established)]
1085
+ end
1082
1086
 
1083
1087
  if block_given?
1088
+ ret = nil
1084
1089
  begin
1085
- yield(sock)
1090
+ ret = yield(socket, request_info)
1086
1091
  rescue
1087
1092
  @socket_cache.revoke if @keepalive
1088
1093
  raise
1089
1094
  else
1090
1095
  @socket_cache.dec_ref if @keepalive
1091
1096
  ensure
1092
- sock.close unless @keepalive
1097
+ socket.close unless @keepalive
1093
1098
  end
1099
+
1100
+ ret
1094
1101
  else
1095
- sock
1102
+ [socket, request_info]
1096
1103
  end
1097
1104
  end
1098
1105
  end
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Fluent
18
18
 
19
- VERSION = '1.5.1'
19
+ VERSION = '1.5.2'
20
20
 
21
21
  end
@@ -649,7 +649,55 @@ EOL
649
649
  assert_equal(['test', time, records[1]], events[1])
650
650
  end
651
651
 
652
- test 'authentication_with_user_auth' do
652
+ test 'keepalive + shared_key' do
653
+ input_conf = TARGET_CONFIG + %[
654
+ <security>
655
+ self_hostname in.localhost
656
+ shared_key fluentd-sharedkey
657
+ </security>
658
+ ]
659
+ target_input_driver = create_target_input_driver(conf: input_conf)
660
+
661
+ output_conf = %[
662
+ send_timeout 51
663
+ keepalive true
664
+ <security>
665
+ self_hostname localhost
666
+ shared_key fluentd-sharedkey
667
+ </security>
668
+ <server>
669
+ name test
670
+ host #{TARGET_HOST}
671
+ port #{TARGET_PORT}
672
+ </server>
673
+ ]
674
+ @d = d = create_driver(output_conf)
675
+
676
+ time = event_time('2011-01-02 13:14:15 UTC')
677
+ records = [{ 'a' => 1 }, { 'a' => 2 }]
678
+ records2 = [{ 'b' => 1}, { 'b' => 2}]
679
+ target_input_driver.run(expect_records: 4, timeout: 15) do
680
+ d.run(default_tag: 'test') do
681
+ records.each do |record|
682
+ d.feed(time, record)
683
+ end
684
+
685
+ d.flush # emit buffer to reuse same socket later
686
+ records2.each do |record|
687
+ d.feed(time, record)
688
+ end
689
+ end
690
+ end
691
+
692
+ events = target_input_driver.events
693
+ assert{ events != [] }
694
+ assert_equal(['test', time, records[0]], events[0])
695
+ assert_equal(['test', time, records[1]], events[1])
696
+ assert_equal(['test', time, records2[0]], events[2])
697
+ assert_equal(['test', time, records2[1]], events[3])
698
+ end
699
+
700
+ test 'authentication_with_user_auth' do
653
701
  input_conf = TARGET_CONFIG + %[
654
702
  <security>
655
703
  self_hostname in.localhost
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.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-05 00:00:00.000000000 Z
11
+ date: 2019-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack