fluent-plugin-syslog-gobi-tls 2.1.33 → 2.1.35

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: abb506339ae5cc58a1b2c98ef35d3a682bf83f9cbc594915c6def38a2c795d93
4
- data.tar.gz: cb27d4b42cd2f7717a30a526819c18bfa7bf6497ccabf15bc5128cdefe293292
3
+ metadata.gz: e2295310b3202cba1128712e76396c65fa7780d4911408b9314bcbf723122781
4
+ data.tar.gz: 93d14bbb1f93cdcd60953293d2b5e3141545c6014955c9254030636958bc134a
5
5
  SHA512:
6
- metadata.gz: 1c41a3f0e43241520a937842dfa14128628eaeda89c2cd7815b6bc12ac5b7c8b6b4fb387a675553dad5a788bbd668687af8996e8a5deaf4b306a237e6981e26c
7
- data.tar.gz: f846220819f5b0f5813d77a9e1da62beab745ffd0c61eead1545fd722d1699f2e3275a505b9a3e482a36cb27229404f3c6f29030b39d579635d74f6332296c7d
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.33'
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
@@ -44,14 +47,26 @@ def can_write(host_ip_port)
44
47
  end
45
48
 
46
49
  def increase_retry(host_ip_port)
47
- $host_backoff_specs_list.each do |backoff_specs|
48
- if backoff_specs.hostIPport == host_ip_port
49
- backoff_specs.failtowrite
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
54
+ begin
55
+ $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
+ if backoff_specs.hostIPport == host_ip_port
58
+ backoff_specs.failtowrite
59
+ end
50
60
  end
61
+ rescue => e
62
+ pp "Error in increase_retry: #{e.message}"
51
63
  end
52
64
  end
53
65
 
54
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
55
70
  $host_backoff_specs_list.each do |backoff_specs|
56
71
  if backoff_specs.hostIPport == host_ip_port
57
72
  backoff_specs.resetRetries
@@ -59,6 +74,15 @@ def reset_tries(host_ip_port)
59
74
  end
60
75
  end
61
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
+
62
86
  module Fluent::Plugin
63
87
  class SyslogTlsOutput < Output
64
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,22 +193,29 @@ module SyslogTls
193
193
  else
194
194
  raise "Unknown select type #{type}"
195
195
  end
196
- pp "2: initialize SSLTransport.select_with_timeout :: " + host_ip_port + " time :: " + Time.now.to_s
197
- if can_write(host_ip_port) == 1
198
- pp "3: initialize SSLTransport.select_with_timeout :: " + host_ip_port + " time :: " + Time.now.to_s
199
- select_with_timeout_var = IO.select(*args)
200
- pp "select_with_timeout_var :: " + select_with_timeout_var.to_s + " :: " + host_ip_port + " time :: " + Time.now.to_s
201
- if select_with_timeout_var
202
- pp "4: initialize SSLTransport.select_with_timeout :: " + host_ip_port + " time :: " + Time.now.to_s
203
- reset_tries(host_ip_port)
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
- increase_retry(host_ip_port)
206
- pp "initialize SSLTransport.select_with_timeout :: Socket timeout" + " time :: " + Time.now.to_s
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
- pp "initialize SSLTransport.select_with_timeout :: Failed to write" + " time :: " + Time.now.to_s
211
- raise("Failed to write #{type}")
218
+ IO.select(*args) || raise("Socket timeout during #{type}")
212
219
  end
213
220
  end
214
221
 
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.33
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-09 00:00:00.000000000 Z
11
+ date: 2024-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd