network_resiliency 0.7.15 → 0.8.0

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: 61590ba8f759273c9da124ffec0f12b42cc49663d14d6bf1bd75ebb4d73639b2
4
- data.tar.gz: 2dbd88e94b47a53990fb2328f65cc614be4cb8580e91e17afac0b35f06db281a
3
+ metadata.gz: a2a0b6dd58bb024a582f951fd5aa8105506a8c2ffee8dddac284128a09fc844a
4
+ data.tar.gz: 7b978707f7788382cca10421190942c7395423d363eb222ddb0e5d1f5f1d734d
5
5
  SHA512:
6
- metadata.gz: ca543341cabe254a16b9cb3d035640c29b719bc721a542d3cfd6bc764af8fd20dfa6fb3f57cd2662997f3b5270574b729ae2402b49625a946c37f3c10633de60
7
- data.tar.gz: 232af6a8de1a7ef893e0e1d745d4d12980fc71cb31156c591584ab38967993168986a9778b41ad842eae363704e3b7e49d9ec8d90755a41da056478046d0b242
6
+ metadata.gz: ae2e38bf103409e575f31245634fca438992e9a50415b5c1d0bfa16e75016513a378ad2f0a9c2adef3c22a6392ef2ed1d9da67c26fff745b799bad2c83806e74
7
+ data.tar.gz: aad0e97f32f64ecb254ee5095375119bf0ff307ab578a7566280e93994c6a59ea3eb3d135a2e1a89bef4ae3f90d4ab94af149dd274594c9f1bcda76f777c2b0e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### v0.8.0 (2024-03-12)
2
+ - secondary timeout
3
+ - cover http socket error
4
+
1
5
  ### v0.7.15 (2024-03-08)
2
6
  - higher def timeouts
3
7
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- network_resiliency (0.7.15)
4
+ network_resiliency (0.8.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -6,10 +6,11 @@ module NetworkResiliency
6
6
  extend self
7
7
 
8
8
  ERRORS = [
9
- Timeout::Error,
10
9
  IOError,
11
- SystemCallError,
12
10
  (OpenSSL::OpenSSLError if defined?(OpenSSL::SSL)),
11
+ SocketError,
12
+ SystemCallError,
13
+ Timeout::Error,
13
14
  ].compact
14
15
 
15
16
  REQUEST_TIMEOUT_HEADER = "X-Request-Timeout"
@@ -1,3 +1,3 @@
1
1
  module NetworkResiliency
2
- VERSION = "0.7.15"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -359,11 +359,16 @@ module NetworkResiliency
359
359
  if p99 < max
360
360
  timeouts << p99
361
361
 
362
- # fallback attempt
363
- if max - p99 > p99
362
+ # make a second, more lenient attempt
363
+
364
+ if p99 * 100 < max
365
+ # max is excessively high
366
+ timeouts << p99 * 100
367
+ elsif p99 * 10 < max
364
368
  # use remaining time for second attempt
365
369
  timeouts << max - p99
366
370
  else
371
+ # max is smallish
367
372
  timeouts << max
368
373
 
369
374
  NetworkResiliency.statsd&.increment(
@@ -385,10 +390,8 @@ module NetworkResiliency
385
390
  else
386
391
  timeouts << p99
387
392
 
388
- # timeouts << p99 * 10 if NetworkResiliency.mode(action) == :resolute
389
-
390
- # unbounded second attempt
391
- timeouts << nil
393
+ # second attempt
394
+ timeouts << p99 * 100
392
395
 
393
396
  NetworkResiliency.statsd&.increment(
394
397
  "network_resiliency.timeout.missing",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: network_resiliency
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.15
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Pepper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-08 00:00:00.000000000 Z
11
+ date: 2024-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug