Commit a9a3a7e
authored
fix: send CONNECT first when recovering a HTTPS request (#2077)
# Issue description
AHC has retry mechanism enabled with up to 5 attempts by default. But
the initial CONNECT is omitted when recovering the HTTPS requests with
IO exceptions. This MR fixes this issue and guarantees the proper
workflow in retries.
It's related to #2071 and fixes a different failing case.
# How the issue is fixed
* For any new connections, make sure there is an initial CONNECT for
WebSocket/HTTPS request.
* For the condition check that a CONNECT has been sent, make sure the
connection the current future attaches is reusable/active.
# Unit test
IOException has various reasons but in the unit test, we emulate it by
closing the connection after receiving the CONNECT request. The internal
recovery process will retry another 4 times, and through an IOException
eventually.
Signed-off-by: Jason Joo <[email protected]>1 parent 8189c92 commit a9a3a7e
File tree
2 files changed
+50
-9
lines changed- client/src
- main/java/org/asynchttpclient/netty/request
- test/java/org/asynchttpclient/proxy
2 files changed
+50
-9
lines changedLines changed: 22 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
100 | 107 | | |
101 | 108 | | |
102 | 109 | | |
| |||
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
109 | | - | |
110 | | - | |
111 | | - | |
| 116 | + | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
| |||
125 | 130 | | |
126 | 131 | | |
127 | 132 | | |
| 133 | + | |
| 134 | + | |
128 | 135 | | |
129 | 136 | | |
130 | 137 | | |
| |||
137 | 144 | | |
138 | 145 | | |
139 | 146 | | |
140 | | - | |
141 | 147 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
145 | 160 | | |
146 | 161 | | |
147 | 162 | | |
| |||
Lines changed: 28 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
159 | | - | |
| 162 | + | |
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
| |||
170 | 173 | | |
171 | 174 | | |
172 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
173 | 190 | | |
174 | 191 | | |
175 | 192 | | |
176 | 193 | | |
177 | 194 | | |
178 | 195 | | |
179 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
180 | 202 | | |
181 | 203 | | |
182 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
183 | 209 | | |
184 | 210 | | |
185 | 211 | | |
| |||
0 commit comments