fluent-plugin-syslog-gobi-tls 2.1.34 → 2.1.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-syslog-tls.gemspec +1 -1
- data/lib/fluent/plugin/out_syslog_tls.rb +18 -0
- data/lib/syslog_tls/host_backoff_specs.rb +4 -0
- data/lib/syslog_tls/ssl_transport.rb +20 -14
- 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: e2295310b3202cba1128712e76396c65fa7780d4911408b9314bcbf723122781
|
4
|
+
data.tar.gz: 93d14bbb1f93cdcd60953293d2b5e3141545c6014955c9254030636958bc134a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 445f0af339ff7b18cdb31c80f256d6b63e118f2afc7690fa24635a30e1616615337aefe1a463e51416380a510207dbe293769c508d0b14b56143d25e1591d76d
|
7
|
+
data.tar.gz: 15313e80462897614b1a389f5979499fd1f1535e6c45783726745fd1b6b48e57441d17547555747eca8a11885aa91a6bd2532b21c98411aa65c28a398743626e
|
@@ -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.35'
|
23
23
|
s.authors = ['thomas morgan']
|
24
24
|
s.email = ['tm@iprog.com']
|
25
25
|
s.summary = %q{Fluent Syslog TLS output plugin}
|
@@ -30,6 +30,9 @@ def add_host_backoff_spec(retries_to_do, host_ip_port)
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def can_write(host_ip_port)
|
33
|
+
if !conatins_host(host_ip_port)
|
34
|
+
add_host_backoff_spec(0, host_ip_port)
|
35
|
+
end
|
33
36
|
begin
|
34
37
|
$host_backoff_specs_list.each do |backoff_specs|
|
35
38
|
if backoff_specs.hostIPport == host_ip_port
|
@@ -45,6 +48,9 @@ end
|
|
45
48
|
|
46
49
|
def increase_retry(host_ip_port)
|
47
50
|
pp "1 :: increase_retry :: " + host_ip_port + " time :: " + Time.now.to_s
|
51
|
+
if !conatins_host(host_ip_port)
|
52
|
+
add_host_backoff_spec(0, host_ip_port)
|
53
|
+
end
|
48
54
|
begin
|
49
55
|
$host_backoff_specs_list.each do |backoff_specs|
|
50
56
|
pp "1 :: increase_retry :: backoff_specs.hostIPport " + backoff_specs.hostIPport + " time :: " + Time.now.to_s
|
@@ -58,6 +64,9 @@ def increase_retry(host_ip_port)
|
|
58
64
|
end
|
59
65
|
|
60
66
|
def reset_tries(host_ip_port)
|
67
|
+
if !conatins_host(host_ip_port)
|
68
|
+
add_host_backoff_spec(0, host_ip_port)
|
69
|
+
end
|
61
70
|
$host_backoff_specs_list.each do |backoff_specs|
|
62
71
|
if backoff_specs.hostIPport == host_ip_port
|
63
72
|
backoff_specs.resetRetries
|
@@ -65,6 +74,15 @@ def reset_tries(host_ip_port)
|
|
65
74
|
end
|
66
75
|
end
|
67
76
|
|
77
|
+
def conatins_host(host_ip_port)
|
78
|
+
$host_backoff_specs_list.each do |backoff_specs|
|
79
|
+
if backoff_specs.hostIPport == host_ip_port
|
80
|
+
return true
|
81
|
+
end
|
82
|
+
end
|
83
|
+
return false
|
84
|
+
end
|
85
|
+
|
68
86
|
module Fluent::Plugin
|
69
87
|
class SyslogTlsOutput < Output
|
70
88
|
Fluent::Plugin.register_output('syslog_tls', self)
|
@@ -18,11 +18,14 @@ 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
|
21
22
|
return 1
|
22
23
|
end
|
23
24
|
if time_passed_since_failure > @baseThreshold ** @retriesToDo
|
25
|
+
pp "canwrite writting after backoff :: time_passed_since_failure" + time_passed_since_failure.to_s + " time :: " + Time.now.to_s
|
24
26
|
return 1
|
25
27
|
else
|
28
|
+
pp "canwrite cannot write BACKINGOFFF :: time_passed_since_failure" + time_passed_since_failure.to_s + " time :: " + Time.now.to_s
|
26
29
|
return 0
|
27
30
|
end
|
28
31
|
end
|
@@ -30,6 +33,7 @@ module SyslogTls
|
|
30
33
|
def failtowrite
|
31
34
|
@retriesToDo += 1
|
32
35
|
@failTime = Time.now
|
36
|
+
pp "failtowrite :: " + @retriesToDo.to_s + " time :: " + Time.now.to_s
|
33
37
|
end
|
34
38
|
|
35
39
|
def resetRetries
|
@@ -193,24 +193,30 @@ module SyslogTls
|
|
193
193
|
else
|
194
194
|
raise "Unknown select type #{type}"
|
195
195
|
end
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
pp "
|
203
|
-
|
196
|
+
if type.to_s == "connect_write"
|
197
|
+
pp "2: initialize SSLTransport.select_with_timeout :: " + host_ip_port + " time :: " + Time.now.to_s
|
198
|
+
if can_write(host_ip_port) == 1
|
199
|
+
pp "3: initialize SSLTransport.select_with_timeout :: " + host_ip_port + " time :: " + Time.now.to_s
|
200
|
+
io_select_return = IO.select(*args)
|
201
|
+
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
|
+
if !ready_sockets.empty?
|
205
|
+
pp "4: initialize SSLTransport.select_with_timeout :: " + host_ip_port + " time :: " + Time.now.to_s
|
206
|
+
reset_tries(host_ip_port)
|
207
|
+
io_select_return
|
208
|
+
else
|
209
|
+
increase_retry(host_ip_port)
|
210
|
+
pp "initialize SSLTransport.select_with_timeout :: Socket timeout" + " time :: " + Time.now.to_s
|
211
|
+
io_select_return || raise("Socket timeout during #{type}")
|
212
|
+
end
|
204
213
|
else
|
205
|
-
|
206
|
-
|
207
|
-
raise("Socket timeout during #{type}")
|
214
|
+
pp "initialize SSLTransport.select_with_timeout :: Failed to write" + " time :: " + Time.now.to_s
|
215
|
+
io_select_return || raise("Failed to write #{type}")
|
208
216
|
end
|
209
217
|
else
|
210
|
-
|
211
|
-
raise("Failed to write #{type}")
|
218
|
+
IO.select(*args) || raise("Socket timeout during #{type}")
|
212
219
|
end
|
213
|
-
ready_sockets || raise("Socket timeout during #{type}")
|
214
220
|
end
|
215
221
|
|
216
222
|
# Forward any methods directly to SSLSocket
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-syslog-gobi-tls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thomas morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|