faraday-highly_available_retries 0.1.0.pre.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/README.md +16 -3
- data/lib/faraday/highly_available_retries/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b722b5bd2334c80ef65eede5716baa97c691f12a1753cc34bb4d3e492f9a5f4a
|
4
|
+
data.tar.gz: 03ec8fbe4a4e01493250ca2ee97ff8d5586a00b305ab1aa2f54fbb138329ba9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74224fe3d1bc2a25158610d619c94f3dace2f0d75fa658c838afd77843707ff404e3d5947dce9d34f3b47b5254db05590f19b2fe20b03c7906d7a613a7aea7a9
|
7
|
+
data.tar.gz: ac903a546e4310d95e11fe87da63807acfee70823ca0f9c564932bd309c5acd0d34630a613e3325343b29c3124bc21725c1670c5ef70b22fab348f11b35003e0
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -11,9 +11,22 @@ This list of IP addresses is then shuffled, and if a request fails to connect to
|
|
11
11
|
And so on and so forth, until the retries are exhausted. If all of the IPs fail, then we cycle back to the first one and try again.
|
12
12
|
|
13
13
|
The reason this is impactful and should be used in conjunction with the retry middleware is that the retry middleware will
|
14
|
-
leave DNS resolution to the OS, which has the potential of
|
15
|
-
|
16
|
-
|
14
|
+
leave DNS resolution to the OS, which has the potential of two pitfalls:
|
15
|
+
|
16
|
+
1. Caching results and not try resolving to a different IP address.
|
17
|
+
2. Leaving resolution to a roll of the dice allowing the same IP to be tried multiple times.
|
18
|
+
|
19
|
+
The issue with the first pitfall is rather obvious, but the second is a bit more subtle. If you have a DNS entry that resolves
|
20
|
+
to 2 IP addresses `[A, B]` and 1 attempt, the OS resolution will result in one of the following list of attempts:
|
21
|
+
|
22
|
+
1. `[A, A]`
|
23
|
+
2. `[A, B]`
|
24
|
+
3. `[B. B]`
|
25
|
+
4. `[B, A]`
|
26
|
+
|
27
|
+
This gives you a 50% chance of hitting the same IP twice, and a 50% chance of hitting the other IP twice, meaning the retry
|
28
|
+
has no effect. By using this gem, you can ensure that the list of IPs is resolved ahead of time and cycled through to ensure
|
29
|
+
a different IP is tried on each attempt.
|
17
30
|
|
18
31
|
## Installation
|
19
32
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday-highly_available_retries
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Invoca Development
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-08-
|
12
|
+
date: 2023-08-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -49,8 +49,8 @@ licenses:
|
|
49
49
|
metadata:
|
50
50
|
allowed_push_host: https://rubygems.org
|
51
51
|
bug_tracker_uri: https://github.com/invoca/faraday-highly_available_retries/issues
|
52
|
-
changelog_uri: https://github.com/invoca/faraday-highly_available_retries/blob/v0.1.0
|
53
|
-
documentation_uri: http://www.rubydoc.info/gems/faraday-highly_available_retries/0.1.0
|
52
|
+
changelog_uri: https://github.com/invoca/faraday-highly_available_retries/blob/v0.1.0/CHANGELOG.md
|
53
|
+
documentation_uri: http://www.rubydoc.info/gems/faraday-highly_available_retries/0.1.0
|
54
54
|
homepage_uri: https://github.com/invoca/faraday-highly_available_retries
|
55
55
|
source_code_uri: https://github.com/invoca/faraday-highly_available_retries
|
56
56
|
wiki_uri: https://github.com/invoca/faraday-highly_available_retries/wiki
|
@@ -68,9 +68,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
68
68
|
version: '4'
|
69
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
|
-
- - "
|
71
|
+
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
73
|
+
version: '0'
|
74
74
|
requirements: []
|
75
75
|
rubygems_version: 3.4.17
|
76
76
|
signing_key:
|