Repository navigation
Commit 9911c99
fix(relay): wait out the leader's pool wait at shared-read gates
Every gate waited at most its cache's 1 s max age for the leader. When
the leader itself queued for a pool connection longer than that, which
is the saturated case these gates target, its waiters gave up, found no
entry and each queued its own read behind it: N misses still cost about
N reads. Checkout stamping already keeps the leader's entry fresh however
long it waited, so the max age no longer needs to bound the wait.
Each gate now waits the writer pool's acquire timeout, which bounds the
leader's pool wait, plus SHARED_READ_STATEMENT_WAIT (1 s) for its
statement. A leader whose statement hangs still stalls waiters only that
long, not the 120 s statement timeout. The wait moves from each call
site into SharedReads, so the three gates cannot drift apart.
The held-pool test now sends eight concurrent misses per cache behind a
connection held past the max age and asserts one database read each, as
well as the checkout stamp. The open-set hung-leader test bounds its pool
acquire timeout so its waiters still give up within the test's window.
Also says "connection checkout" in the cache docs that still said the
read "began".
Co-authored-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Luke Tornquist <[email protected]>1 parent 06850f7 commit 9911c99
2 files changed
Lines changed: 159 additions & 83 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
49 | | - | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
| |||
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
70 | | - | |
71 | | - | |
| 77 | + | |
| 78 | + | |
72 | 79 | | |
73 | 80 | | |
74 | 81 | | |
75 | | - | |
| 82 | + | |
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
79 | | - | |
| 86 | + | |
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
| |||
87 | 94 | | |
88 | 95 | | |
89 | 96 | | |
90 | | - | |
| 97 | + | |
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
94 | 101 | | |
95 | | - | |
96 | | - | |
| 102 | + | |
| 103 | + | |
97 | 104 | | |
98 | | - | |
99 | | - | |
| 105 | + | |
| 106 | + | |
100 | 107 | | |
101 | 108 | | |
0 commit comments