Commit 607fcfd
The connect retry gets a budget instead of three tries.
Three attempts were not enough. A refused connection (GATT_ERROR 133)
comes back in about 0.35 s, so the whole budget was spent in under three
seconds, and the bench kept reaching the end of it: two connects in 34 on
2026-08-28 needed all three attempts, which puts the next one along - the
connect that would need a fourth - at about one in forty. That is the
transfer flake the BLE suite was still reporting after the first fix, at
1 of 38 connects.
Six attempts now, bounded by CONNECT_TOTAL_BUDGET_MS rather than by
counting, because the two failures cost very different amounts of time. A
refusal answers in 0.35 s; a device that is switched off gives no callback
at all and burns the full CONNECT_TIMEOUT_MS. Counting alone would have
left the cheap case barely faster and turned the expensive one into a
minute in front of a progress dialog. With the clock bound a burst of
refusals gets all six attempts in about four seconds, and a board that is
simply off still reports in twenty-five.
Two green passes followed, 35 connects with no failure, two of them
recovering on the third attempt - each one a single bad draw from failing
under the old ceiling, and one of them the connection engine rather than
the transfer, which is the first time that retry has been seen to save
anything.
Honest limit: the flake itself did not reproduce here - the pass before
this change was green too, and the per-attempt 133 rate visibly varies
with how long a phone has been running. The case for the number rests on
the measured cost of an attempt and on the observed depth of the retries,
not on a before-and-after rate measured in one afternoon.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent ee1819b commit 607fcfd
2 files changed
Lines changed: 33 additions & 5 deletions
Lines changed: 26 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
329 | 330 | | |
330 | 331 | | |
331 | 332 | | |
| 333 | + | |
332 | 334 | | |
333 | 335 | | |
334 | 336 | | |
| |||
351 | 353 | | |
352 | 354 | | |
353 | 355 | | |
354 | | - | |
355 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
356 | 360 | | |
357 | 361 | | |
358 | 362 | | |
| |||
991 | 995 | | |
992 | 996 | | |
993 | 997 | | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
994 | 1006 | | |
995 | | - | |
| 1007 | + | |
996 | 1008 | | |
997 | 1009 | | |
998 | 1010 | | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
999 | 1022 | | |
1000 | 1023 | | |
1001 | 1024 | | |
| |||
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| 172 | + | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
| |||
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
190 | | - | |
191 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
192 | 197 | | |
193 | 198 | | |
194 | 199 | | |
| |||
0 commit comments