httpx 0.20.1 → 0.20.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/release_notes/0_20_2.md +7 -0
- data/lib/httpx/connection.rb +6 -0
- data/lib/httpx/resolver/native.rb +6 -2
- data/lib/httpx/selector.rb +9 -2
- data/lib/httpx/version.rb +1 -1
- data/sig/connection.rbs +3 -0
- data/sig/resolver/native.rbs +3 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b49337207a605c716ef9a1043660239ced7f5060758148f905be6c1d5546a8bc
|
4
|
+
data.tar.gz: 732ffb35912e5176827941034b74ce2777d744e828e1ed86351bdd221f010d19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c1f12fa0d1675f8e8c478ea272456f910dc558b7836eaf0bfa6e916d29439e7dd093ffdde4903a43b474559909052df4d26872846e704c393045f10d496a53a
|
7
|
+
data.tar.gz: 9011bf6d1826ea2a44a3570f9dcbe9dc5bb319303809cf8b44247f9ac2bdb099ccc0895192155960df320dbdad4bebf009a7ec77dc1e37d1e8e27a59077efe5a
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# 0.20.2
|
2
|
+
|
3
|
+
## Bugfixes
|
4
|
+
|
5
|
+
* fix for selector timeout errors closing all connections and ignoring resolvers.
|
6
|
+
|
7
|
+
Timeout errors on select were being propagated to all pooled connections, although not all of them were being selected on, and not all of them having timed out. plus, resolver timeouts were doing the same, making connections fail with connection timeout error, rather than resolve timeout error. A patch was implemented, where the selector now yields an error to the selected connections, rather than plain raising exception.
|
data/lib/httpx/connection.rb
CHANGED
@@ -276,6 +276,12 @@ module HTTPX
|
|
276
276
|
@state == :open || @state == :inactive
|
277
277
|
end
|
278
278
|
|
279
|
+
def raise_timeout_error(interval)
|
280
|
+
error = HTTPX::TimeoutError.new(interval, "timed out while waiting on select")
|
281
|
+
error.set_backtrace(caller)
|
282
|
+
on_error(error)
|
283
|
+
end
|
284
|
+
|
279
285
|
private
|
280
286
|
|
281
287
|
def connect
|
@@ -118,6 +118,10 @@ module HTTPX
|
|
118
118
|
@timeouts.values_at(*hosts).reject(&:empty?).map(&:first).min
|
119
119
|
end
|
120
120
|
|
121
|
+
def raise_timeout_error(interval)
|
122
|
+
do_retry(interval)
|
123
|
+
end
|
124
|
+
|
121
125
|
private
|
122
126
|
|
123
127
|
def calculate_interests
|
@@ -134,10 +138,10 @@ module HTTPX
|
|
134
138
|
dwrite if calculate_interests == :w
|
135
139
|
end
|
136
140
|
|
137
|
-
def do_retry
|
141
|
+
def do_retry(loop_time = nil)
|
138
142
|
return if @queries.empty? || !@start_timeout
|
139
143
|
|
140
|
-
loop_time
|
144
|
+
loop_time ||= Utils.elapsed_time(@start_timeout)
|
141
145
|
|
142
146
|
query = @queries.first
|
143
147
|
|
data/lib/httpx/selector.rb
CHANGED
@@ -74,7 +74,10 @@ class HTTPX::Selector
|
|
74
74
|
|
75
75
|
readers, writers = IO.select(r, w, nil, interval)
|
76
76
|
|
77
|
-
|
77
|
+
if readers.nil? && writers.nil? && interval
|
78
|
+
[*r, *w].each { |io| io.raise_timeout_error(interval) }
|
79
|
+
return
|
80
|
+
end
|
78
81
|
rescue IOError, SystemCallError
|
79
82
|
@selectables.reject!(&:closed?)
|
80
83
|
retry
|
@@ -108,7 +111,11 @@ class HTTPX::Selector
|
|
108
111
|
when nil then return
|
109
112
|
end
|
110
113
|
|
111
|
-
|
114
|
+
unless result || interval.nil?
|
115
|
+
io.raise_timeout_error(interval)
|
116
|
+
return
|
117
|
+
end
|
118
|
+
# raise HTTPX::TimeoutError.new(interval, "timed out while waiting on select")
|
112
119
|
|
113
120
|
yield io
|
114
121
|
rescue IOError, SystemCallError
|
data/lib/httpx/version.rb
CHANGED
data/sig/connection.rbs
CHANGED
data/sig/resolver/native.rbs
CHANGED
@@ -27,6 +27,8 @@ module HTTPX
|
|
27
27
|
|
28
28
|
def timeout: () -> Numeric?
|
29
29
|
|
30
|
+
def raise_timeout_error: (Numeric interval) -> void
|
31
|
+
|
30
32
|
private
|
31
33
|
|
32
34
|
def initialize: (ip_family family, options options) -> void
|
@@ -35,7 +37,7 @@ module HTTPX
|
|
35
37
|
|
36
38
|
def consume: () -> void
|
37
39
|
|
38
|
-
def do_retry: () -> void
|
40
|
+
def do_retry: (?Numeric loop_time) -> void
|
39
41
|
|
40
42
|
def dread: (Integer) -> void
|
41
43
|
| () -> void
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2-next
|
@@ -82,6 +82,7 @@ extra_rdoc_files:
|
|
82
82
|
- doc/release_notes/0_1_0.md
|
83
83
|
- doc/release_notes/0_20_0.md
|
84
84
|
- doc/release_notes/0_20_1.md
|
85
|
+
- doc/release_notes/0_20_2.md
|
85
86
|
- doc/release_notes/0_2_0.md
|
86
87
|
- doc/release_notes/0_2_1.md
|
87
88
|
- doc/release_notes/0_3_0.md
|
@@ -156,6 +157,7 @@ files:
|
|
156
157
|
- doc/release_notes/0_1_0.md
|
157
158
|
- doc/release_notes/0_20_0.md
|
158
159
|
- doc/release_notes/0_20_1.md
|
160
|
+
- doc/release_notes/0_20_2.md
|
159
161
|
- doc/release_notes/0_2_0.md
|
160
162
|
- doc/release_notes/0_2_1.md
|
161
163
|
- doc/release_notes/0_3_0.md
|