fluent-plugin-syslog-gobi-tls 2.1.35 → 2.1.36
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f1260ee80a0b5a4e6a50278b3f882c3110a8a668504636c8c42b8305dfbf79d
|
4
|
+
data.tar.gz: 84c64d91c00a2e5e8cb45bb0ccee71dc9a52cca335fa5e323fa5251c25849d3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9345dd2aef77181aedb9592bb902c70254af0ccca25f03f20dde25f7ae34423a2120bfad9a21e7ed921a16f0ae4a68d013829bc30f944db0861d1509889b585f
|
7
|
+
data.tar.gz: c29439b149b58fc2645f2abb6a42eb64f4875a4ee09ce7c99dd34b2b7bbc619d8c3f7b9847ad56586ef82f5d2edd03ccbfd24303edaeb91ae6d413a59d69dbe0
|
@@ -19,7 +19,7 @@ require 'syslog_tls/version'
|
|
19
19
|
|
20
20
|
Gem::Specification.new do |s|
|
21
21
|
s.name = 'fluent-plugin-syslog-gobi-tls'
|
22
|
-
s.version = '2.1.
|
22
|
+
s.version = '2.1.36'
|
23
23
|
s.authors = ['thomas morgan']
|
24
24
|
s.email = ['tm@iprog.com']
|
25
25
|
s.summary = %q{Fluent Syslog TLS output plugin}
|
@@ -47,13 +47,11 @@ def can_write(host_ip_port)
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def increase_retry(host_ip_port)
|
50
|
-
pp "1 :: increase_retry :: " + host_ip_port + " time :: " + Time.now.to_s
|
51
50
|
if !conatins_host(host_ip_port)
|
52
51
|
add_host_backoff_spec(0, host_ip_port)
|
53
52
|
end
|
54
53
|
begin
|
55
54
|
$host_backoff_specs_list.each do |backoff_specs|
|
56
|
-
pp "1 :: increase_retry :: backoff_specs.hostIPport " + backoff_specs.hostIPport + " time :: " + Time.now.to_s
|
57
55
|
if backoff_specs.hostIPport == host_ip_port
|
58
56
|
backoff_specs.failtowrite
|
59
57
|
end
|
@@ -18,14 +18,16 @@ module SyslogTls
|
|
18
18
|
time_passed_since_failure = time_passed_since_failure.round(2)
|
19
19
|
end
|
20
20
|
if time_passed_since_failure == -1
|
21
|
-
pp "canwrite writting :: time_passed_since_failure" + time_passed_since_failure.to_s + " time :: " + Time.now.to_s
|
22
21
|
return 1
|
23
22
|
end
|
24
|
-
|
23
|
+
backoffTime = @baseThreshold ** @retriesToDo
|
24
|
+
if backoffTime > 3600
|
25
|
+
backoffTime = 3600
|
26
|
+
end
|
27
|
+
if time_passed_since_failure > backoffTime
|
25
28
|
pp "canwrite writting after backoff :: time_passed_since_failure" + time_passed_since_failure.to_s + " time :: " + Time.now.to_s
|
26
29
|
return 1
|
27
30
|
else
|
28
|
-
pp "canwrite cannot write BACKINGOFFF :: time_passed_since_failure" + time_passed_since_failure.to_s + " time :: " + Time.now.to_s
|
29
31
|
return 0
|
30
32
|
end
|
31
33
|
end
|
@@ -33,7 +35,6 @@ module SyslogTls
|
|
33
35
|
def failtowrite
|
34
36
|
@retriesToDo += 1
|
35
37
|
@failTime = Time.now
|
36
|
-
pp "failtowrite :: " + @retriesToDo.to_s + " time :: " + Time.now.to_s
|
37
38
|
end
|
38
39
|
|
39
40
|
def resetRetries
|
@@ -31,7 +31,6 @@ module SyslogTls
|
|
31
31
|
attr_writer :retries
|
32
32
|
|
33
33
|
def initialize(host, port, idle_timeout: nil, ca_cert: 'system', client_cert: nil, client_key: nil, verify_cert_name: true, ssl_version: :TLS1_2, max_retries: 1)
|
34
|
-
pp "initialize SSLTransport"
|
35
34
|
@host = host
|
36
35
|
@port = port
|
37
36
|
@idle_timeout = idle_timeout
|
@@ -46,23 +45,18 @@ module SyslogTls
|
|
46
45
|
|
47
46
|
def connect
|
48
47
|
timwnow = Time.now
|
49
|
-
pp "initialize SSLTransport.connect"+ timwnow.to_s
|
50
48
|
@socket = get_ssl_connection
|
51
49
|
begin
|
52
50
|
begin
|
53
51
|
@socket.connect_nonblock
|
54
52
|
rescue Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitReadable
|
55
|
-
pp "initialize SSLTransport Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitReadable"
|
56
53
|
select_with_timeout(@socket, :connect_read) && retry
|
57
54
|
rescue IO::WaitWritable
|
58
|
-
pp "initialize SSLTransport IO::WaitWritable"
|
59
55
|
select_with_timeout(@socket, :connect_write) && retry
|
60
56
|
end
|
61
57
|
rescue Errno::ETIMEDOUT
|
62
|
-
pp "initialize SSLTransport Errno::ETIMEDOUT"
|
63
58
|
raise 'Socket timeout during connect'
|
64
59
|
end
|
65
|
-
pp "initialize SSLTransport last_write"
|
66
60
|
@last_write = Time.now if idle_timeout
|
67
61
|
end
|
68
62
|
|
@@ -132,9 +126,7 @@ module SyslogTls
|
|
132
126
|
|
133
127
|
# Allow to retry on failed writes
|
134
128
|
def write(s)
|
135
|
-
pp "initialize SSLTransport.write"
|
136
129
|
if idle_timeout
|
137
|
-
pp "initialize SSLTransport.write idle_timeout" + idle_timeout.to_s
|
138
130
|
if (t=Time.now) > @last_write + idle_timeout
|
139
131
|
@socket.close rescue nil
|
140
132
|
connect
|
@@ -143,7 +135,6 @@ module SyslogTls
|
|
143
135
|
end
|
144
136
|
end
|
145
137
|
begin
|
146
|
-
pp "initialize SSLTransport.write !idle_timeout"
|
147
138
|
retry_id ||= 0
|
148
139
|
do_write(s)
|
149
140
|
rescue => e
|
@@ -177,10 +168,7 @@ module SyslogTls
|
|
177
168
|
end
|
178
169
|
|
179
170
|
def select_with_timeout(tcp, type)
|
180
|
-
|
181
171
|
host_ip_port = host + ":" + port.to_s
|
182
|
-
pp "1: initialize SSLTransport.select_with_timeout :: " + host_ip_port + " time :: " + Time.now.to_s
|
183
|
-
|
184
172
|
case type
|
185
173
|
when :connect_read
|
186
174
|
args = [[tcp], nil, nil, CONNECT_TIMEOUT]
|
@@ -194,24 +182,17 @@ module SyslogTls
|
|
194
182
|
raise "Unknown select type #{type}"
|
195
183
|
end
|
196
184
|
if type.to_s == "connect_write"
|
197
|
-
pp "2: initialize SSLTransport.select_with_timeout :: " + host_ip_port + " time :: " + Time.now.to_s
|
198
185
|
if can_write(host_ip_port) == 1
|
199
|
-
pp "3: initialize SSLTransport.select_with_timeout :: " + host_ip_port + " time :: " + Time.now.to_s
|
200
186
|
io_select_return = IO.select(*args)
|
201
187
|
ready_sockets, _, _ = io_select_return
|
202
|
-
pp "ready_sockets :: " + ready_sockets.to_s + " :: " + host_ip_port + " time :: " + Time.now.to_s
|
203
|
-
pp "io_select_return :: " + io_select_return.to_s + " :: " + host_ip_port + " time :: " + Time.now.to_s
|
204
188
|
if !ready_sockets.empty?
|
205
|
-
pp "4: initialize SSLTransport.select_with_timeout :: " + host_ip_port + " time :: " + Time.now.to_s
|
206
189
|
reset_tries(host_ip_port)
|
207
190
|
io_select_return
|
208
191
|
else
|
209
192
|
increase_retry(host_ip_port)
|
210
|
-
pp "initialize SSLTransport.select_with_timeout :: Socket timeout" + " time :: " + Time.now.to_s
|
211
193
|
io_select_return || raise("Socket timeout during #{type}")
|
212
194
|
end
|
213
195
|
else
|
214
|
-
pp "initialize SSLTransport.select_with_timeout :: Failed to write" + " time :: " + Time.now.to_s
|
215
196
|
io_select_return || raise("Failed to write #{type}")
|
216
197
|
end
|
217
198
|
else
|