Commit fef7203
Plug ensureConnected leak; consolidate varint helpers
Review cleanups:
- ensureConnected's start()-failure catch now closes cursorSendLoop
before nulling client. Previously it closed only the client; because
the connected flag is set past the catch, a caller that retries --
re-entering ensureConnected and reassigning cursorSendLoop -- orphaned
a recovered slot's ctor-seeded native mirror. That is a reachable leak
on the recovered-slot + start()/dispatcher-OOM + retry path. close() is
idempotent and frees the mirror via its loopNeverRan path, and also
closes the shared client, so the following client.close() is a no-op.
- Consolidated the triplicated raw-address varint writer into
NativeBufferWriter.writeVarint (writeVarintDirect now delegates to it);
PersistedSymbolDict and the catch-up frame builder in
CursorWebSocketSendLoop use it, and PersistedSymbolDict.varintSize now
reuses NativeBufferWriter.varintSize.
- Alphabetized CursorSendEngine (getPersistedSymbolDict before
getTotalBackpressureStalls before isDeltaDictEnabled) and moved
PersistedSymbolDict.decodeVarint to the front of its private-static
cluster.
- readVarintAt gained the shift > 35 defensive bound that decodeVarint
already has (unreachable today, all inputs are freshly-encoded or
validated varints, but consistent).
- CursorWebSocketSendLoopCatchUpAlignmentTest now uses the existing
TestUtils.createTmpDir/removeTmpDir instead of reinventing them.
Not changed: the reported dead CursorSendEngine.isMemoryMode() and a
PersistedSymbolDict MAX_ENTRY_LEN constant do not exist at HEAD (the
former removed earlier on this branch, the latter never present), and the
NativeBufferWriter import is already correctly ordered. The
buildAck/waitFor/rmDir/readVarint test helpers are duplicated across ~19
pre-existing test files, so consolidating them belongs in a dedicated
repo-wide test-hygiene change rather than this feature PR.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 186ae10 commit fef7203
6 files changed
Lines changed: 77 additions & 93 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
Lines changed: 16 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
79 | 94 | | |
80 | 95 | | |
81 | 96 | | |
| |||
336 | 351 | | |
337 | 352 | | |
338 | 353 | | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
| 354 | + | |
344 | 355 | | |
345 | 356 | | |
346 | 357 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3362 | 3362 | | |
3363 | 3363 | | |
3364 | 3364 | | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
3365 | 3376 | | |
3366 | 3377 | | |
3367 | 3378 | | |
| |||
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
622 | 631 | | |
623 | 632 | | |
624 | 633 | | |
| |||
641 | 650 | | |
642 | 651 | | |
643 | 652 | | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
| |||
Lines changed: 10 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2161 | 2161 | | |
2162 | 2162 | | |
2163 | 2163 | | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
2164 | 2172 | | |
2165 | 2173 | | |
2166 | 2174 | | |
| |||
2310 | 2318 | | |
2311 | 2319 | | |
2312 | 2320 | | |
2313 | | - | |
2314 | | - | |
| 2321 | + | |
| 2322 | + | |
2315 | 2323 | | |
2316 | 2324 | | |
2317 | 2325 | | |
| |||
2331 | 2339 | | |
2332 | 2340 | | |
2333 | 2341 | | |
2334 | | - | |
2335 | | - | |
2336 | | - | |
2337 | | - | |
2338 | | - | |
2339 | | - | |
2340 | | - | |
2341 | | - | |
2342 | | - | |
2343 | 2342 | | |
2344 | 2343 | | |
2345 | 2344 | | |
| |||
Lines changed: 29 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
221 | | - | |
| 222 | + | |
222 | 223 | | |
223 | 224 | | |
224 | | - | |
| 225 | + | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| |||
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
260 | | - | |
| 261 | + | |
261 | 262 | | |
262 | | - | |
| 263 | + | |
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
| |||
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
354 | 379 | | |
355 | 380 | | |
356 | 381 | | |
| |||
473 | 498 | | |
474 | 499 | | |
475 | 500 | | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | 501 | | |
519 | 502 | | |
520 | 503 | | |
| |||
Lines changed: 2 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | | - | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
| |||
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
81 | | - | |
82 | | - | |
83 | | - | |
| 79 | + | |
84 | 80 | | |
85 | 81 | | |
86 | 82 | | |
87 | 83 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 84 | + | |
105 | 85 | | |
106 | 86 | | |
107 | 87 | | |
| |||
0 commit comments