Commit 70c706a
committed
fix(qwp): foreground role-reject retry backs off exponentially, not a fixed-interval TLS storm
The cursor I/O loop's role-reject branch reset backoff to
reconnect_initial_backoff_millis, parked exactly that interval (no
jitter, no growth), then `continue`d -- bypassing the shared capped
exponential backoff-with-jitter block. Once an all-replica failover
window (or a misconfigured replicas-only address list, now surfaced
here as a retriable role reject rather than a terminal durable-ack
mismatch) reaches this branch, every sweep pinned at ~100ms forever:
a fixed ~10-20 handshakes/s storm of fresh WebSocketClient (2x64KB
native) + fresh SSLContext (no session resumption, trust-store
re-read) per endpoint. That broke the documented
capped-exponential-backoff contract and was ~50x more aggressive than
the orphan drainer, which already grows to reconnect_max_backoff_millis.
Fall through to the shared backoff block so role-reject grows to
reconnect_max_backoff_millis (5s default) like every other reconnect
branch, and emit a throttled WARN naming the all-replica condition.
close() still unparks the loop via LockSupport, so shutdown stays
prompt under the longer park (QwpRoleRejectCloseRaceTest green).
Adds QwpRoleRejectBackoffGrowthTest as a red-first guard: on the old
behaviour the inter-attempt gaps are flat ([52,51,51,51,51,51]ms);
after the fix they grow exponentially.
Also lands accompanying connect-timeout / Invariant-B doc and comment
refinements across Sender, QwpWebSocketSender, BackgroundDrainer,
SenderConnectionEvent, QwpVersionMismatchException, and the design
notes, plus .gitignore entries for root /target and .pi-subagents/.1 parent b990535 commit 70c706a
16 files changed
Lines changed: 626 additions & 88 deletions
File tree
- core/src
- main/java/io/questdb/client
- cutlass/qwp/client
- sf/cursor
- test/java/io/questdb/client/test/cutlass/qwp/client
- sf/cursor
- design
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
799 | 800 | | |
800 | 801 | | |
801 | 802 | | |
| |||
2388 | 2389 | | |
2389 | 2390 | | |
2390 | 2391 | | |
2391 | | - | |
2392 | | - | |
2393 | | - | |
2394 | | - | |
2395 | | - | |
2396 | | - | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
2397 | 2399 | | |
2398 | | - | |
2399 | | - | |
| 2400 | + | |
| 2401 | + | |
2400 | 2402 | | |
2401 | 2403 | | |
2402 | 2404 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
227 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
| |||
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
Lines changed: 11 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
233 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
234 | 235 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
| |||
2316 | 2317 | | |
2317 | 2318 | | |
2318 | 2319 | | |
2319 | | - | |
| 2320 | + | |
2320 | 2321 | | |
2321 | 2322 | | |
2322 | 2323 | | |
| |||
2891 | 2892 | | |
2892 | 2893 | | |
2893 | 2894 | | |
2894 | | - | |
2895 | | - | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
2896 | 2898 | | |
2897 | 2899 | | |
2898 | 2900 | | |
| |||
Lines changed: 35 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
339 | 351 | | |
340 | 352 | | |
341 | 353 | | |
342 | 354 | | |
343 | 355 | | |
344 | 356 | | |
345 | 357 | | |
346 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
347 | 363 | | |
348 | 364 | | |
349 | 365 | | |
| |||
352 | 368 | | |
353 | 369 | | |
354 | 370 | | |
355 | | - | |
356 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
357 | 389 | | |
358 | 390 | | |
359 | 391 | | |
| |||
0 commit comments