Commit 3a3330d
committed
senders: resolve and use a random address on websockets connect
Resolve websocket remote address and pick a random one as an explicit
host to connect. The combination of asyncio websockets and asyncio
create_connect() have some overlapping timeouts that lead to connection
attempts to run through the whole list of targets returned by
getaddrinfo(). This breaks connectivity in some dual stack IPv6/IPv4
cases, when either one of the address family has e.g. routing problems.
We can fairly safely pick one at random here; we have retry logic built
around the connections anyway that eventually lead to connected state.1 parent c62e2ea commit 3a3330d
1 file changed
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
| 168 | + | |
| 169 | + | |
166 | 170 | | |
167 | 171 | | |
168 | 172 | | |
| |||
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
179 | 199 | | |
180 | 200 | | |
181 | | - | |
| 201 | + | |
182 | 202 | | |
| 203 | + | |
183 | 204 | | |
184 | 205 | | |
185 | 206 | | |
| |||
0 commit comments