Skip to content

sort: report merge output flush errors - #13910

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

sort: report merge output flush errors#13910
DePasqualeOrg wants to merge 3 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

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/dd/misc. tests/dd/misc is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/df/over-mount-device. tests/df/over-mount-device is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/io-errors (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/retry (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/cat/splice is no longer failing!
Congrats! The gnu test tests/cp/cp-a-selinux is no longer failing!
Congrats! The gnu test tests/cut/cut is no longer failing!
Congrats! The gnu test tests/cut/mb-non-utf8 is no longer failing!
Congrats! The gnu test tests/dd/partial-write is no longer failing!
Congrats! The gnu test tests/expand/mb is no longer failing!
Congrats! The gnu test tests/ls/stat-free-symlinks is no longer failing!
Congrats! The gnu test tests/misc/close-stdout is no longer failing!
Congrats! The gnu test tests/mktemp/write-error is no longer failing!
Congrats! The gnu test tests/mv/dir2dir is no longer failing!
Congrats! The gnu test tests/mv/mv-exchange is no longer failing!
Congrats! The gnu test tests/nl/multibyte is no longer failing!
Congrats! The gnu test tests/od/od-float is no longer failing!
Congrats! The gnu test tests/od/od-j is no longer failing!
Congrats! The gnu test tests/ptx/ptx-overrun is no longer failing!
Congrats! The gnu test tests/sort/sort-merge-fdlimit is no longer failing!
Congrats! The gnu test tests/unexpand/mb is no longer failing!
Note: The gnu test tests/csplit/csplit-heap is now being skipped but was previously passing.
Note: The gnu test tests/dd/fail-ftruncate-fstat was skipped on 'main' but is now failing.

@codspeed-hq

codspeed-hq Bot commented Aug 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 52 untouched benchmarks
⏩ 360 skipped benchmarks1


Comparing DePasqualeOrg:sort-output-write-errors (82e437e) with main (dfb953d)2

Open in CodSpeed

Footnotes

  1. 360 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 (48a2013) during the generation of this report, so dfb953d 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