Skip to content

split: fix I/O error handling for device full conditions#11239

Open
sylvestre wants to merge 1 commit intouutils:mainfrom
sylvestre:split-io
Open

split: fix I/O error handling for device full conditions#11239
sylvestre wants to merge 1 commit intouutils:mainfrom
sylvestre:split-io

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

Should fix tests/split/split-io-err.sh

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 8, 2026

GNU testsuite comparison:

GNU test failed: tests/misc/io-errors. tests/misc/io-errors is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/split/filter. tests/split/filter is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/rm/many-dir-entries-vs-OOM is now passing!
Congrats! The gnu test tests/tail/pipe-f is now passing!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 8, 2026

Merging this PR will degrade performance by 17.56%

❌ 3 regressed benchmarks
✅ 294 untouched benchmarks
⏩ 48 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation split_bytes 429.2 µs 463.3 µs -7.36%
Simulation split_lines 5.6 ms 6.8 ms -17.56%
Simulation split_numeric_suffix 5.9 ms 7.1 ms -16.93%

Comparing sylvestre:split-io (b1028c8) with main (ff6dd99)

Open in CodSpeed

Footnotes

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 9, 2026

GNU testsuite comparison:

GNU test failed: tests/split/filter. tests/split/filter is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/split/split-io-err is no longer failing!
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.
Congrats! The gnu test tests/rm/many-dir-entries-vs-OOM is now passing!
Congrats! The gnu test tests/tail/pipe-f is now passing!

@sylvestre sylvestre marked this pull request as ready for review March 16, 2026 21:39
Should fix tests/split/split-io-err.sh
@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/split/filter. tests/split/filter is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/date/resolution (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/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/split/split-io-err is no longer failing!
Note: The gnu test tests/printf/printf-surprise is now being skipped but was previously passing.
Congrats! The gnu test tests/expand/bounded-memory is now passing!

@kevinburkesegment
Copy link
Copy Markdown
Contributor

I was looking at implementing the same patch - what do you think, did you avoid merging this because of the performance concerns?

Comment thread src/uu/split/src/split.rs
Comment on lines +573 to +578
fn custom_write<T: Write>(
bytes: &[u8],
writer: &mut T,
settings: &Settings,
error_context: Option<(&str, &mut bool)>,
) -> io::Result<usize> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would split this function into two functions to avoid the Option for error_context and the if let conditions in the function.

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.

3 participants