Commit bb12854
authored
Attempt parallel connections to all addrs when connecting (#1068)
* Attempt parallel connections to all addrs when connecting
Part of the "happy eyeballs" recommendations.
Note I attempted to preserve the exception throwing behavior we had
previously. i.e. if I'm the last task running and errors, I'll close
the `Channel{TCPSocket}` with my exception which will then propagate up.
We could possibly accumulate all the exceptions into a CompositeException,
but meh, I'm not sure if that adds much value.
In addition to the new parallel connecting, we're also adjusting how
the `connect_timeout` is implemented. Instead of only applying to the
tcp connection, we now wrap the entire `newconnection` call, which means
any ssl handshake timing will also count towards the timeout. We saw a
case at RelationalAI where we had a reasonable connect_timeout (10s),
yet then saw long requests (>50s) where all the time was reported in
the connection layer. It would seem to suggest that the ssl layer is
somehow getting stuck or slow, so the proposal here is that if the ssl
operations also count, then we'll more aggressively cancel/restart
the connection process in the case of slow ssl handshaking.
* Ensure we don't have hanging tasks once our channel has been filled w/ connection1 parent ba68375 commit bb12854
2 files changed
+29
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
504 | | - | |
505 | 504 | | |
506 | 505 | | |
507 | 506 | | |
508 | 507 | | |
509 | 508 | | |
510 | 509 | | |
511 | | - | |
512 | | - | |
| 510 | + | |
| 511 | + | |
513 | 512 | | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
529 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
530 | 531 | | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | 532 | | |
535 | 533 | | |
536 | | - | |
537 | | - | |
| 534 | + | |
538 | 535 | | |
539 | 536 | | |
540 | 537 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
| |||
0 commit comments