fluent-plugin-syslog-tls-with-backoff-test 2.1.4 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/syslog_tls/host_backoff_specs.rb +3 -4
- data/lib/syslog_tls/ssl_transport.rb +7 -1
- data/lib/syslog_tls/version.rb +1 -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: 472ffd61e55f71d65601e4c51cea49441d492c57e8739f7a4d7a9851d651a1a2
|
4
|
+
data.tar.gz: c7453eb9f6101914200bc34d772d53177b6cc415ed4a0c8bbd24be400e567c50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 885508abe507408daf1b191e092dac11e5ab93ad64fde054bf1768b091bacb99b3f92adbf507692dbc11e6a544760c837b1eff067a27ad4d1655604b3e1a0912
|
7
|
+
data.tar.gz: ac388020d61421c4a8d9042be0683e1d672f4c8f13ad0a870ac177a480d77a737fb2476cffe81bb306d3ccc8776fe78b4d87e1ae48d5e0ad5ec8e11c1a438790
|
@@ -14,12 +14,11 @@ module SyslogTls
|
|
14
14
|
def canwrite
|
15
15
|
time_passed_since_failure = -1
|
16
16
|
if @failTime != nil
|
17
|
-
pp "
|
17
|
+
pp "canwrite :: @failTime != nil :: retriesToDo :: " + @retriesToDo.to_s + " failTime :: " + @failTime.to_s
|
18
18
|
time_passed_since_failure = Time.now - @failTime
|
19
19
|
time_passed_since_failure = time_passed_since_failure.round(2)
|
20
20
|
end
|
21
21
|
if time_passed_since_failure == -1
|
22
|
-
pp "time_passed_since_failure is -1"
|
23
22
|
return 1
|
24
23
|
end
|
25
24
|
backoffTime = @baseThreshold ** @retriesToDo
|
@@ -37,13 +36,13 @@ module SyslogTls
|
|
37
36
|
def failtowrite
|
38
37
|
@retriesToDo += 1
|
39
38
|
@failTime = Time.now
|
40
|
-
pp "
|
39
|
+
pp "failtowrite :: retriesToDo :: " + @retriesToDo.to_s + " failTime :: " + Time.now.to_s
|
41
40
|
end
|
42
41
|
|
43
42
|
def resetRetries
|
44
43
|
@retriesToDo = 0
|
45
44
|
@failTime = nil
|
46
|
-
pp "
|
45
|
+
pp "resetRetries :: retriesToDo :: " + @retriesToDo.to_s + " failTime :: " + @failTime.to_s
|
47
46
|
end
|
48
47
|
end
|
49
48
|
end
|
@@ -52,6 +52,7 @@ module SyslogTls
|
|
52
52
|
rescue Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitReadable
|
53
53
|
select_with_timeout(@socket, :connect_read) && retry
|
54
54
|
rescue IO::WaitWritable
|
55
|
+
pp "connect :: select_with_timeout(@socket, :connect_write) && retry time :: " + Time.now.to_s
|
55
56
|
select_with_timeout(@socket, :connect_write) && retry
|
56
57
|
end
|
57
58
|
rescue Errno::ETIMEDOUT
|
@@ -75,6 +76,7 @@ module SyslogTls
|
|
75
76
|
tcp.setsockopt(Socket::SOL_SOCKET, Socket::Constants::SO_REUSEPORT, true)
|
76
77
|
tcp.connect_nonblock(sock_addr)
|
77
78
|
rescue Errno::EINPROGRESS
|
79
|
+
pp "get_tcp_connection :: select_with_timeout(tcp, :connect_write) time :: " + Time.now.to_s
|
78
80
|
select_with_timeout(tcp, :connect_write)
|
79
81
|
begin
|
80
82
|
tcp.connect_nonblock(sock_addr)
|
@@ -158,6 +160,7 @@ module SyslogTls
|
|
158
160
|
if e.is_a?(OpenSSL::SSL::SSLError) && e.message !~ /write would block/
|
159
161
|
raise e
|
160
162
|
else
|
163
|
+
pp "do_write :: select_with_timeout(@socket, :write) time :: " + Time.now.to_s
|
161
164
|
select_with_timeout(@socket, :write) && retry
|
162
165
|
end
|
163
166
|
end
|
@@ -169,6 +172,8 @@ module SyslogTls
|
|
169
172
|
|
170
173
|
def select_with_timeout(tcp, type)
|
171
174
|
host_ip_port = host + ":" + port.to_s
|
175
|
+
pp "select_with_timeout :: time :: " + Time.now.to_s + " :: host_ip_port :: " + host_ip_port
|
176
|
+
pp "select_with_timeout :: type :: " + type.to_s
|
172
177
|
case type
|
173
178
|
when :connect_read
|
174
179
|
args = [[tcp], nil, nil, CONNECT_TIMEOUT]
|
@@ -182,8 +187,8 @@ module SyslogTls
|
|
182
187
|
raise "Unknown select type #{type}"
|
183
188
|
end
|
184
189
|
if type.to_s == "connect_write"
|
190
|
+
pp "select_with_timeout :: if :: time :: " + Time.now.to_s + " :: host_ip_port :: " + host_ip_port
|
185
191
|
if can_write(host_ip_port) == 1
|
186
|
-
pp "in can_write at time::" + Time.now.to_s
|
187
192
|
io_select_return = IO.select(*args)
|
188
193
|
ready_sockets, _, _ = io_select_return
|
189
194
|
if !ready_sockets.empty?
|
@@ -197,6 +202,7 @@ module SyslogTls
|
|
197
202
|
# raise("Failed to write #{type}")
|
198
203
|
end
|
199
204
|
else
|
205
|
+
pp "select_with_timeout :: else :: time :: " + Time.now.to_s + " :: host_ip_port :: " + host_ip_port
|
200
206
|
IO.select(*args) || raise("Socket timeout during #{type}")
|
201
207
|
end
|
202
208
|
end
|
data/lib/syslog_tls/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-syslog-tls-with-backoff-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thomas morgan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-05-
|
12
|
+
date: 2024-05-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|