Commit 9b9b1ff
committed
Cap pre-auth handshake recv at 5 s so bad-protocol clients fail fast
Both bare-TCP and WS hosts inherit the listener's 0.5 s socket timeout
on accept(). Bumping that to 60 s covered the WS handshake on slow CI
runners but introduced the inverse hang: a peer that never sends
"\r\n\r\n" (the plain-TCP-into-WS rejection test) deadlocked the server
for the full 60 s and exceeded pytest's per-test budget.
Split the timeouts: 5 s for the pre-auth step (TLS wrap, WS upgrade) —
microseconds is plenty on loopback, 5 s absorbs scheduler starvation,
and shorter than pytest --timeout so wrong-protocol clients fail fast.
The auth exchange that follows still uses the original 60 s budget set
inside _ClientHandler._authenticate.1 parent 0929195 commit 9b9b1ff
2 files changed
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
554 | 561 | | |
555 | 562 | | |
556 | 563 | | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
557 | 576 | | |
558 | 577 | | |
559 | 578 | | |
| |||
594 | 613 | | |
595 | 614 | | |
596 | 615 | | |
597 | | - | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
598 | 619 | | |
599 | 620 | | |
600 | 621 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
0 commit comments