Skip to content

sort: report merge output flush errors - #13910

Open
DePasqualeOrg wants to merge 2 commits into
uutils:mainfrom
DePasqualeOrg:sort-output-write-errors
Open

sort: report merge output flush errors#13910
DePasqualeOrg wants to merge 2 commits into
uutils:mainfrom
DePasqualeOrg:sort-output-write-errors

Conversation

@DePasqualeOrg

@DePasqualeOrg DePasqualeOrg commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Unlike ordinary sort output, sort --merge did not flush its output before returning. This could hide a write failure and cause sort to exit successfully. This change adds the missing flush and a regression test.

An automated review with Codex found separate error-handling problems that are not addressed here. I'm flagging them for potential future work:

  • External-sort temporary-file writes still use unwrap(), so an I/O failure can panic instead of being reported normally.
  • Plain temporary files rely on drop-time flushing, which cannot report a final flush error.
  • Compressed temporary-file failures require careful cleanup so that the compressor’s input is closed and the child is reaped while preserving the original I/O error. Current error paths do not always guarantee this.

Comment thread src/uu/sort/src/merge.rs Outdated
@DePasqualeOrg DePasqualeOrg changed the title sort: propagate output write errors sort: report merge output flush errors Aug 13, 2026
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/symlink (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/dd/no-allocate is now passing!

@codspeed-hq

codspeed-hq Bot commented Aug 13, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ 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

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 345 untouched benchmarks
🆕 10 new benchmarks
⏩ 46 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation numfmt_large_numbers_si[10000] 94.7 ms 98.1 ms -3.4%
Simulation df_with_path 704.9 µs 573.7 µs +22.86%
🆕 Memory ptx_input_references_short_lines[100000] N/A 222.2 MB N/A
🆕 Memory ptx_long_lines[100] N/A 29.5 MB N/A
🆕 Memory ptx_short_lines[100000] N/A 240.1 MB N/A
🆕 Memory ptx_input_references_long_lines[1000] N/A 29.1 MB N/A
🆕 Memory ptx_tex[10000] N/A 20.6 MB N/A
🆕 Simulation ptx_input_references_short_lines[100000] N/A 16.2 s N/A
🆕 Simulation ptx_long_lines[100] N/A 1.7 s N/A
🆕 Simulation ptx_short_lines[100000] N/A 14 s N/A
🆕 Simulation ptx_input_references_long_lines[1000] N/A 2 s N/A
🆕 Simulation ptx_tex[10000] N/A 2.9 s N/A

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing DePasqualeOrg:sort-output-write-errors (4265a9c) with main (66cf72b)2

Open in CodSpeed

Footnotes

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

  2. No successful run was found on main (e1efa7d) during the generation of this report, so 66cf72b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@DePasqualeOrg
DePasqualeOrg marked this pull request as ready for review August 13, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants