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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/fluent/plugin/out_forward.rb +24 -17
- data/lib/fluent/version.rb +1 -1
- data/test/plugin/test_out_forward.rb +49 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e5e328bed0abe290a9ae9b9f4b84fc725064340f4b440e346eaa353dff653f8
|
4
|
+
data.tar.gz: b61c74d2c260da91d2141d261db4787448677e1926c63e3a5b08f5d5f98cfc82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af15e7b57e2bde74c846e71f768e7293901e68b4fc1d3a6d6a2620874d43df272611a44337b40437ec1307d2964cec5b7f057ac7c7451a2f89f1e74a8b40d679
|
7
|
+
data.tar.gz: b4a0e4c283faf5f8ff2144ad337a5993a99c0bfc2e4eae43dbad9b234d0f6a03420fcb4a149151effdc1976b507760eb453b754ced5ff4c6b8f323d4c9d3afad
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
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(
|
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
|
-
|
1097
|
+
socket.close unless @keepalive
|
1093
1098
|
end
|
1099
|
+
|
1100
|
+
ret
|
1094
1101
|
else
|
1095
|
-
|
1102
|
+
[socket, request_info]
|
1096
1103
|
end
|
1097
1104
|
end
|
1098
1105
|
end
|
data/lib/fluent/version.rb
CHANGED
@@ -649,7 +649,55 @@ EOL
|
|
649
649
|
assert_equal(['test', time, records[1]], events[1])
|
650
650
|
end
|
651
651
|
|
652
|
-
test '
|
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.
|
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-
|
11
|
+
date: 2019-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|