Skip to content

fix(ipc): fill the buffer on partial reads in the sync message reader - #10284

Merged
joseph-isaacs merged 1 commit into
vortex-data:developfrom
jackylee-ch:fix/ipc-sync-reader-short-read
Oct 20, 2026
Merged

joseph-isaacs merged 1 commit into
vortex-data:developfrom
jackylee-ch:fix/ipc-sync-reader-short-read

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

What

SyncMessageReader did a single read into the resized buffer and handed it 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.

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 AsyncMessageReader already has.

AI assistance

Prepared with AI assistance; I have reviewed and verified the change.

`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>
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added the stale This PR is stale and will be auto-closed soon label Oct 19, 2026
@jackylee-ch

Copy link
Copy Markdown
Contributor Author

Closing this for now to keep my open PRs focused — happy to reopen if it's still wanted.

@robert3005 robert3005 reopened this Oct 20, 2026
@robert3005

Copy link
Copy Markdown
Contributor

Let's merge this one, I think it's useful to get a better error

@robert3005
robert3005 enabled auto-merge (squash) October 20, 2026 13:04
@codspeed

codspeed Bot commented Oct 20, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 17.46%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ 1 benchmark measured no execution time

Nothing ran under measurement, usually because the compiler removed the code under test. This result is not comparable, so it counts as unchanged.

Preventing compiler optimizations

⚠️ 17 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 40 benchmarks have no flame graph

The flamegraph could not be generated because we failed to resolve the symbols in the profiling trace. This happens when we fail to harvest information about language frames.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 5 improved benchmarks
❌ 2 regressed benchmarks
✅ 2401 untouched benchmarks
⏩ 12 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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)

Open in CodSpeed

Footnotes

  1. 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. ↩

@joseph-isaacs joseph-isaacs added changelog/fix A bug fix and removed stale This PR is stale and will be auto-closed soon labels Oct 20, 2026
@joseph-isaacs
joseph-isaacs enabled auto-merge (squash) October 20, 2026 13:36
@joseph-isaacs
joseph-isaacs merged commit c4afd68 into vortex-data:develop Oct 20, 2026
116 of 120 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants