Repository navigation
fix(ipc): fill the buffer on partial reads in the sync message reader - #10284
joseph-isaacs merged 1 commit into
Conversation
`SyncMessageReader` issued a single `read` into the resized buffer and handed it straight to the decoder. On a short read — legal for any `Read`, common over pipes and sockets — the buffer kept its zero padding, which the decoder treats as real data (it checks `remaining()`, not bytes written) and decodes as garbage. Loop until the buffer is filled before decoding, and report a truncated stream as an error instead of returning garbage, mirroring the async reader. Signed-off-by: jackylee-ch <qcsd2011@gmail.com>
|
This PR has been marked as stale because it has been open for 14 days with no activity. Please comment or remove the stale label if you wish to keep it active, otherwise it will be closed in 7 days |
|
Closing this for now to keep my open PRs focused — happy to reopen if it's still wanted. |
|
Let's merge this one, I think it's useful to get a better error |
Merging this PR will degrade performance by 17.46%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | bench_compare_sliced_dict_primitive[(2000, 10000)] |
13.9 µs | 68.6 µs | -79.74% |
| ❌ | Simulation | density_sweep_dense_runs[0.001] |
44.2 µs | 62.3 µs | -28.94% |
| ⚡ ℹ️ | Simulation | test_scan_filter_to_arrow_array[int_float] |
4.1 ms | 3.5 ms | +15.8% |
| ⚡ | WallTime | bitpack_blocked_compress_avx2 |
7.6 µs | 6.7 µs | +12.83% |
| ⚡ ℹ️ | Simulation | test_repeated_scan_filter[int_float] |
3.9 ms | 3.4 ms | +12.38% |
| ⚡ ℹ️ | Simulation | test_repeated_scan_filter[int] |
2.7 ms | 2.4 ms | +11.28% |
| ⚡ ℹ️ | Simulation | test_scan_filter_to_arrow_array[int] |
2.8 ms | 2.5 ms | +10.92% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing jackylee-ch:fix/ipc-sync-reader-short-read (257eb7c) with develop (7216cb5)
Footnotes
-
12 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
What
SyncMessageReaderdid a singlereadinto the resized buffer and handed it tothe decoder. On a short read — legal for any
Read, common over pipes andsockets — the buffer kept its zero padding, which the decoder treats as real data
(it checks
remaining(), not bytes written) and decodes as garbage.Fix
Loop until the buffer is filled before decoding, and report a truncated stream as
an error instead of returning garbage. This mirrors the partial-read handling the
async
AsyncMessageReaderalready has.AI assistance
Prepared with AI assistance; I have reviewed and verified the change.