fix(qwp): repair sender state after rollback, clear, and flush - #77
fix(qwp): repair sender state after rollback, clear, and flush#77jerrinot wants to merge 4 commits into
Conversation
…er clear/rollback Senders cache designated-timestamp ColumnBuffer refs and derive bookkeeping from their table buffers. rollbackUncommittedColumns() (failed at()) and QwpTableBuffer.clear() close those columns, leaving dangling refs that NPE on the next at() and corrupt pending accounting. - Invalidate WebSocket timestamp caches in rollbackRow(); cancelRow() now routes through it. - Add QwpTableBuffer.Owner: clear() notifies the owning sender before releasing columns. WebSocket subtracts the buffer's exact accounted share (committedBytes - new baselineBytes, seed offsets excluded); UDP resets transient row state, datagram estimate, and headroom state (its base-estimate cache is keyed by column count alone). - Unify flush snapshot anchoring at post-reset storage so per-table contributions are exact under any reset/switch/flush history. Hot path unchanged. Regressions: clear between rows (both units, both senders), non-current/mid-row clear, accounting locality, stale headroom estimate.
|
All four review agents plus my own trace converge: no correctness, concurrency, resource, performance, or accounting defect. The fresh-context adversarial agent independently ran the suites (108 tests) plus a custom probe of the one untested path and found nothing. Here is the verified report. Review: PR #77 —
|
Track the bounded creation wait and handled interrupts in one atomic test witness. Handshake repeated interrupts until the original wait exits so the regression tests reject deadline resets without depending on scheduler timing.
Exercise current-buffer clear with committed and in-progress rows so cached timestamps and pending counters must be repaired. Add a real flush regression that excludes retained var-width seed bytes from subsequent pending-byte accounting.
[PR Coverage check]😍 pass : 47 / 48 (97.92%) file detail
|
Review: PR #77 —
|
After rejecting an oversized timestamped row, a QWP sender could fail subsequent rows with a
NullPointerException. This fix keeps the sender usable after rollback and ensures auto-flush and UDP size calculations remain accurate after buffers are cleared or flushed.