Commit 8126bcf
committed
Read the router's ready byte before reuse
A recycled connection is not free until the peer's reader lets it go,
and rumors readers can be lazy. The pool handed connections out as
soon as the writer finished, so a stream could sit undelivered behind
the previous stream's consumer. Mutual gossip sessions wait on each
other's streams, and the extra dependency closed a wait cycle. The CI
conformance suite deadlocked there.
The router now writes one byte on a recovered connection when it
starts reading for the next header. Recycle reads that byte in a
spawned task and clears the dirty bit only once it arrives, so the
pool never hands out a connection the peer still holds. max_slots
grows to cover claims parked on the byte.1 parent f969073 commit 8126bcf
3 files changed
Lines changed: 34 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| |||
347 | 349 | | |
348 | 350 | | |
349 | 351 | | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
355 | 363 | | |
356 | 364 | | |
357 | 365 | | |
| |||
0 commit comments