You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(qwp): pin slot retention when worker-exit handoff registration fails
A throw from deferUntilWorkerExit (allocation failure while building the
handoff) carries no worker-liveness information, so close() must retain
every worker-reachable resource instead of running terminal cleanup
inline under a possibly-live worker. Add a test seam that throws from
the registration path while the worker is provably mid service pass and
assert the slot flock, ring and watermark are retained, close stays
incomplete, and a retried close() after worker exit converges and
releases the slot.
Copy file name to clipboardExpand all lines: core/src/test/java/io/questdb/client/test/cutlass/qwp/client/sf/cursor/CursorSendEngineSlotReacquisitionTest.java
+114Lines changed: 114 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -409,6 +409,120 @@ public void testOwnedEngineCloseHandsCleanupToWorkerExit() throws Exception {
409
409
});
410
410
}
411
411
412
+
/**
413
+
* Registration-failure twin of
414
+
* {@link #testOwnedEngineCloseHandsCleanupToWorkerExit}: when
415
+
* {@code deferUntilWorkerExit} itself throws (allocation failure while
416
+
* building the handoff), close() must NOT mistake the swallowed throw
417
+
* for "worker already exited" and run the terminal cleanup inline — the
418
+
* worker is provably still mid service pass, so releasing the ring,
419
+
* watermark or slot flock here is the original stale-worker UAF/data-loss
420
+
* hazard. Every worker-reachable resource must be retained and the close
421
+
* must stay incomplete; a retried close() after the worker exits
0 commit comments