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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/network_resiliency/adapter/http.rb +3 -2
- data/lib/network_resiliency/version.rb +1 -1
- data/lib/network_resiliency.rb +9 -6
- 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: a2a0b6dd58bb024a582f951fd5aa8105506a8c2ffee8dddac284128a09fc844a
|
4
|
+
data.tar.gz: 7b978707f7788382cca10421190942c7395423d363eb222ddb0e5d1f5f1d734d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae2e38bf103409e575f31245634fca438992e9a50415b5c1d0bfa16e75016513a378ad2f0a9c2adef3c22a6392ef2ed1d9da67c26fff745b799bad2c83806e74
|
7
|
+
data.tar.gz: aad0e97f32f64ecb254ee5095375119bf0ff307ab578a7566280e93994c6a59ea3eb3d135a2e1a89bef4ae3f90d4ab94af149dd274594c9f1bcda76f777c2b0e
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -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"
|
data/lib/network_resiliency.rb
CHANGED
@@ -359,11 +359,16 @@ module NetworkResiliency
|
|
359
359
|
if p99 < max
|
360
360
|
timeouts << p99
|
361
361
|
|
362
|
-
#
|
363
|
-
|
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
|
-
#
|
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.
|
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-
|
11
|
+
date: 2024-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|