fluent-plugin-syslog-tls-with-backoff-test 2.1.4 → 2.1.5

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: c1bb968a4a6a7c07da2c7047ec444a7a4fbdbe961fd6fe1edcc1e77f8bb47ebf
4
- data.tar.gz: 909550358898c5f29acda3067c140d9e1a1ac540cdc092359cb0ea243e50ee78
3
+ metadata.gz: f63360e8ba81c074c2a2e97ba6fc1992c1266a3f343be95e906ca0720c0e50ef
4
+ data.tar.gz: 50cd80391373d67d4df98686a15d182eb2706eef8987894356748414f65b6f70
5
5
  SHA512:
6
- metadata.gz: 73a0bb71e9458f7ae3fe7222513c831af91a618f1047b05bf2c6b99be566e6986072c06c9d4529e6939082d12618f27956f1073379b55cf6f3fdbd164d0dd0e7
7
- data.tar.gz: 4f63efb95b3e2a58777250d7e10f5f11b7031fa38741a0feeed13bcef1ed78d53deaa940a2755cc771baf53eb0f6155c68ddf6a7ebc059de200a18cee486aff2
6
+ metadata.gz: 8bef8e2ced5f69828b8df0e54298e1405c8353d86716277450effb68c52b5e86d8ec2da4a9681a877b196ce15daeffe9fb3cbcfbb747baf807bd5ba975bea4c9
7
+ data.tar.gz: 2b75cfea01bd9e1d5e85b609e49de3445d52f27e87977a85602c491179afbe2fea877c4959a124bdf1e14012ba8ebd8599f06f8750ec85754568abc9640e8a71
data/.gitignore CHANGED
@@ -37,4 +37,3 @@ build/
37
37
 
38
38
  ## System
39
39
  .DS_Store
40
- .vscode
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-syslog-tls-with-backoff (2.1.0)
4
+ fluent-plugin-syslog-tls (2.1.0.rc1)
5
5
  fluentd (>= 0.14.0, < 2)
6
6
 
7
7
  GEM
@@ -9,41 +9,35 @@ GEM
9
9
  specs:
10
10
  addressable (2.8.1)
11
11
  public_suffix (>= 2.0.2, < 6.0)
12
- base64 (0.2.0)
13
- concurrent-ruby (1.2.3)
14
- cool.io (1.8.0)
12
+ concurrent-ruby (1.1.10)
13
+ cool.io (1.7.1)
15
14
  crack (0.4.5)
16
15
  rexml
17
- csv (3.3.0)
18
16
  docile (1.4.0)
19
- drb (2.2.1)
20
- fluentd (1.17.0)
21
- base64 (~> 0.2)
17
+ fluentd (1.15.3)
22
18
  bundler
23
19
  cool.io (>= 1.4.5, < 2.0.0)
24
- csv (~> 3.2)
25
- drb (~> 2.2)
26
20
  http_parser.rb (>= 0.5.1, < 0.9.0)
27
21
  msgpack (>= 1.3.1, < 2.0.0)
28
- serverengine (>= 2.3.2, < 3.0.0)
29
- sigdump (~> 0.2.5)
22
+ serverengine (>= 2.3.0, < 3.0.0)
23
+ sigdump (~> 0.2.2)
30
24
  strptime (>= 0.2.4, < 1.0.0)
31
25
  tzinfo (>= 1.0, < 3.0)
32
26
  tzinfo-data (~> 1.0)
33
- webrick (~> 1.4)
27
+ webrick (>= 1.4.2, < 1.8.0)
34
28
  yajl-ruby (~> 1.0)
35
29
  hashdiff (1.0.1)
36
30
  http_parser.rb (0.8.0)
37
31
  minitest (5.17.0)
38
32
  minitest-stub_any_instance (1.0.3)
39
- msgpack (1.7.2)
33
+ msgpack (1.6.0)
40
34
  power_assert (2.0.3)
41
35
  public_suffix (5.0.1)
42
36
  rake (13.0.6)
43
37
  rexml (3.2.5)
44
- serverengine (2.3.2)
38
+ serverengine (2.3.1)
45
39
  sigdump (~> 0.2.2)
46
- sigdump (0.2.5)
40
+ sigdump (0.2.4)
47
41
  simplecov (0.22.0)
48
42
  docile (~> 1.1)
49
43
  simplecov-html (~> 0.11)
@@ -53,22 +47,22 @@ GEM
53
47
  strptime (0.2.5)
54
48
  test-unit (3.5.7)
55
49
  power_assert
56
- tzinfo (2.0.6)
50
+ tzinfo (2.0.5)
57
51
  concurrent-ruby (~> 1.0)
58
- tzinfo-data (1.2024.1)
52
+ tzinfo-data (1.2022.7)
59
53
  tzinfo (>= 1.0.0)
60
54
  webmock (3.18.1)
61
55
  addressable (>= 2.8.0)
62
56
  crack (>= 0.3.2)
63
57
  hashdiff (>= 0.4.0, < 2.0.0)
64
- webrick (1.8.1)
58
+ webrick (1.7.0)
65
59
  yajl-ruby (1.4.3)
66
60
 
67
61
  PLATFORMS
68
62
  ruby
69
63
 
70
64
  DEPENDENCIES
71
- fluent-plugin-syslog-tls-with-backoff!
65
+ fluent-plugin-syslog-tls!
72
66
  minitest (~> 5.8)
73
67
  minitest-stub_any_instance (~> 1.0.0)
74
68
  rake
@@ -20,11 +20,11 @@ require 'syslog_tls/version'
20
20
  Gem::Specification.new do |s|
21
21
  s.name = 'fluent-plugin-syslog-tls-with-backoff-test'
22
22
  s.version = SyslogTls::VERSION
23
- s.authors = ['thomas morgan', 'muhammad adil ghaffar']
24
- s.email = ['tm@iprog.com', 'muhammad.sdil.ghaffar@est.tech']
23
+ s.authors = ['thomas morgan']
24
+ s.email = ['tm@iprog.com']
25
25
  s.summary = %q{Fluent Syslog TLS output plugin}
26
- s.description = %q{Syslog TLS output plugin with formatting support, for Fluentd. This is cutom version backoff.}
27
- s.homepage = 'https://github.com/Nordix/fluent-plugin-syslog-tls/tree/add-expo-backoff/adil'
26
+ s.description = %q{Syslog TLS output plugin with formatting support, for Fluentd}
27
+ s.homepage = 'https://github.com/zarqman/fluent-plugin-syslog-tls'
28
28
  s.license = 'Apache v2'
29
29
  s.files = `git ls-files`.split($/)
30
30
  s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -16,70 +16,6 @@
16
16
  require 'socket'
17
17
  require 'syslog_tls/logger'
18
18
  require 'fluent/plugin/output'
19
- require 'syslog_tls/host_backoff_specs'
20
- require 'pp'
21
-
22
- $host_backoff_specs_list = []
23
-
24
- def add_host_backoff_spec(retries_to_do, host_ip_port)
25
- # Check if an element with the same hostIPport already exists
26
- return if $host_backoff_specs_list.any? { |spec| spec.hostIPport == host_ip_port }
27
-
28
- # If not, add a new HostBackoffSpecs instance to the global array
29
- $host_backoff_specs_list << ::SyslogTls::HostBackoffSpecs.new(retries_to_do, host_ip_port)
30
- end
31
-
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
36
- begin
37
- $host_backoff_specs_list.each do |backoff_specs|
38
- if backoff_specs.hostIPport == host_ip_port
39
- return backoff_specs.canwrite
40
- end
41
- end
42
- rescue => e
43
- pp "Error in can_write: #{e.message}"
44
- return 0
45
- end
46
- return 1
47
- end
48
-
49
- def increase_retry(host_ip_port)
50
- if !conatins_host(host_ip_port)
51
- add_host_backoff_spec(0, host_ip_port)
52
- end
53
- begin
54
- $host_backoff_specs_list.each do |backoff_specs|
55
- if backoff_specs.hostIPport == host_ip_port
56
- backoff_specs.failtowrite
57
- end
58
- end
59
- rescue => e
60
- pp "Error in increase_retry: #{e.message}"
61
- end
62
- end
63
-
64
- def reset_tries(host_ip_port)
65
- if !conatins_host(host_ip_port)
66
- add_host_backoff_spec(0, host_ip_port)
67
- end
68
- $host_backoff_specs_list.each do |backoff_specs|
69
- if backoff_specs.hostIPport == host_ip_port
70
- backoff_specs.resetRetries
71
- end
72
- end
73
- end
74
-
75
- def conatins_host(host_ip_port)
76
- $host_backoff_specs_list.each do |backoff_specs|
77
- if backoff_specs.hostIPport == host_ip_port
78
- return true
79
- end
80
- end
81
- return false
82
- end
83
19
 
84
20
  module Fluent::Plugin
85
21
  class SyslogTlsOutput < Output
@@ -146,8 +82,6 @@ module Fluent::Plugin
146
82
  @mappings[key_name] = conf[conf_key] if conf.key?(conf_key)
147
83
  end
148
84
 
149
- add_host_backoff_spec(0, conf['host']+":"+conf['port'])
150
-
151
85
  @formatter = formatter_create(conf: conf.elements('format').first, default_type: DEFAULT_FORMAT_TYPE)
152
86
  end
153
87
 
@@ -15,7 +15,6 @@
15
15
 
16
16
  require 'socket'
17
17
  require 'openssl'
18
- require 'pp'
19
18
 
20
19
  module SyslogTls
21
20
  # Supports SSL connection to remote host
@@ -44,7 +43,6 @@ module SyslogTls
44
43
  end
45
44
 
46
45
  def connect
47
- timwnow = Time.now
48
46
  @socket = get_ssl_connection
49
47
  begin
50
48
  begin
@@ -168,7 +166,6 @@ module SyslogTls
168
166
  end
169
167
 
170
168
  def select_with_timeout(tcp, type)
171
- host_ip_port = host + ":" + port.to_s
172
169
  case type
173
170
  when :connect_read
174
171
  args = [[tcp], nil, nil, CONNECT_TIMEOUT]
@@ -181,24 +178,7 @@ module SyslogTls
181
178
  else
182
179
  raise "Unknown select type #{type}"
183
180
  end
184
- if type.to_s == "connect_write"
185
- if can_write(host_ip_port) == 1
186
- pp "in can_write at time::" + Time.now.to_s
187
- io_select_return = IO.select(*args)
188
- ready_sockets, _, _ = io_select_return
189
- if !ready_sockets.empty?
190
- reset_tries(host_ip_port)
191
- io_select_return
192
- else
193
- increase_retry(host_ip_port)
194
- io_select_return || raise("Socket timeout during #{type}")
195
- end
196
- # else
197
- # raise("Failed to write #{type}")
198
- end
199
- else
200
- IO.select(*args) || raise("Socket timeout during #{type}")
201
- end
181
+ IO.select(*args) || raise("Socket timeout during #{type}")
202
182
  end
203
183
 
204
184
  # Forward any methods directly to SSLSocket
@@ -14,5 +14,5 @@
14
14
  # limitations under the License.
15
15
 
16
16
  module SyslogTls
17
- VERSION = '2.1.4'
17
+ VERSION = '2.1.5'
18
18
  end
metadata CHANGED
@@ -1,15 +1,14 @@
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
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - thomas morgan
8
- - muhammad adil ghaffar
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-05-16 00:00:00.000000000 Z
11
+ date: 2024-05-20 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: fluentd
@@ -115,11 +114,9 @@ dependencies:
115
114
  - - "~>"
116
115
  - !ruby/object:Gem::Version
117
116
  version: '0.11'
118
- description: Syslog TLS output plugin with formatting support, for Fluentd. This is
119
- cutom version backoff.
117
+ description: Syslog TLS output plugin with formatting support, for Fluentd
120
118
  email:
121
119
  - tm@iprog.com
122
- - muhammad.sdil.ghaffar@est.tech
123
120
  executables: []
124
121
  extensions: []
125
122
  extra_rdoc_files: []
@@ -137,7 +134,6 @@ files:
137
134
  - fluent-plugin-syslog-tls.gemspec
138
135
  - lib/fluent/plugin/out_syslog_tls.rb
139
136
  - lib/syslog_tls/facility.rb
140
- - lib/syslog_tls/host_backoff_specs.rb
141
137
  - lib/syslog_tls/logger.rb
142
138
  - lib/syslog_tls/lookup_from_const.rb
143
139
  - lib/syslog_tls/protocol.rb
@@ -150,7 +146,7 @@ files:
150
146
  - test/syslog_tls/test_logger.rb
151
147
  - test/syslog_tls/test_protocol.rb
152
148
  - test/syslog_tls/test_ssl_transport.rb
153
- homepage: https://github.com/Nordix/fluent-plugin-syslog-tls/tree/add-expo-backoff/adil
149
+ homepage: https://github.com/zarqman/fluent-plugin-syslog-tls
154
150
  licenses:
155
151
  - Apache v2
156
152
  metadata: {}
@@ -1,49 +0,0 @@
1
- require 'pp'
2
-
3
- module SyslogTls
4
- class HostBackoffSpecs
5
- attr_accessor :retriesToDo, :hostIPport
6
-
7
- def initialize(retries_to_do, host_ip_port)
8
- @retriesToDo = retries_to_do
9
- @hostIPport = host_ip_port
10
- @failTime = nil
11
- @baseThreshold = 2
12
- end
13
-
14
- def canwrite
15
- time_passed_since_failure = -1
16
- if @failTime != nil
17
- pp "failtime not nil in canwrite ::" + @failTime.to_s
18
- time_passed_since_failure = Time.now - @failTime
19
- time_passed_since_failure = time_passed_since_failure.round(2)
20
- end
21
- if time_passed_since_failure == -1
22
- pp "time_passed_since_failure is -1"
23
- return 1
24
- end
25
- backoffTime = @baseThreshold ** @retriesToDo
26
- if backoffTime > 1800
27
- backoffTime = 1800
28
- end
29
- if time_passed_since_failure > backoffTime
30
- pp "canwrite writting after backoff :: time_passed_since_failure" + time_passed_since_failure.to_s + " time :: " + Time.now.to_s
31
- return 1
32
- else
33
- return 0
34
- end
35
- end
36
-
37
- def failtowrite
38
- @retriesToDo += 1
39
- @failTime = Time.now
40
- pp "in failtowrite retries :: " + retriesToDo.to_s + " failTime:: " + @failTime.to_s
41
- end
42
-
43
- def resetRetries
44
- @retriesToDo = 0
45
- @failTime = nil
46
- pp "in reset retries"
47
- end
48
- end
49
- end