Commit 98a4ac0
Don't key the cap-gap episode off nanoTime's sign
sendDictCatchUp tested `catchUpCapGapFirstNanos < 0` to decide whether a
symbol-dictionary cap-gap episode was already open. A System.nanoTime()
instant is only meaningful as a difference: its origin is arbitrary and
the spec permits negative values, so its sign cannot encode state.
CursorWebSocketSendLoopCatchUpAlignmentTest backdates the episode anchor
by two hours to prove that a cap gap outliving the escalation window
latches a terminal. On Linux nanoTime() is nanos-since-boot, so on a
freshly booted CI agent it sits far below two hours of nanos and the
backdated anchor came out negative. The loop then read that real anchor
as "unset", re-anchored it to now on every strike and pinned
episodeNanos at ~0: the dwell was never satisfied, no terminal latched,
and the test failed. It fails on every machine with under two hours of
uptime and on no long-lived dev box, which is why only CI saw it.
Key the episode off the strike count instead, exactly as
recordHeadRejectionStrike keys its own off poisonStrikes. -1 survives as
a debug marker but no longer decides anything, so no state rides on a
timestamp's sign.
Add testCapGapEpisodeWithANegativeAnchorStillEscalates, which plants the
negative anchor directly and so pins the sentinel whatever the host's
uptime; the existing test only reddens where uptime happens to fall under
its two-hour backdate.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 3b73bc8 commit 98a4ac0
2 files changed
Lines changed: 89 additions & 10 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: 24 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
313 | 317 | | |
314 | 318 | | |
315 | 319 | | |
| |||
2442 | 2446 | | |
2443 | 2447 | | |
2444 | 2448 | | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
2445 | 2459 | | |
2446 | | - | |
| 2460 | + | |
2447 | 2461 | | |
2448 | 2462 | | |
2449 | 2463 | | |
| |||
Lines changed: 65 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 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 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
333 | 398 | | |
334 | 399 | | |
335 | 400 | | |
| |||
0 commit comments