Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

cre4ture
Copy link
Contributor

@cre4ture cre4ture commented Feb 27, 2024

addresses issue #5902.

The relevant gnu test tests/dd/stats.sh is now green.

Changes:

  • extend the Alarm-flag with a manual trigger that gets triggered by each received SIGUSR1 signal
  • fix block writing to also consider fullblock cmd line arg. It retries partial writes when this is set.

@cre4ture cre4ture changed the title handle SIGUSR1 directly. not just every 1sec dd: handle SIGUSR1 directly. not just every 1sec Feb 27, 2024
@cre4ture cre4ture force-pushed the feature/dd_direct_progress branch 3 times, most recently from 6eca368 to cf5fc49 Compare March 9, 2024 20:43
@cre4ture cre4ture force-pushed the feature/dd_direct_progress branch from cf5fc49 to c2613ad Compare March 18, 2024 23:43
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/dd/stats is no longer failing!


pub fn is_triggered(&self) -> bool {
self.trigger.swap(false, Relaxed)
pub fn manual_trigger_fn(&self) -> Box<dyn Send + Sync + Fn()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be nice to add some comments explaining what it is doing

}
}

fn flush_caches_full_length(i: &Input, o: &Output) -> std::io::Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

same

@sylvestre sylvestre force-pushed the feature/dd_direct_progress branch from c2613ad to a35dafc Compare March 23, 2024 11:22
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/dd/stats is no longer failing!

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/dd/stats is no longer failing!

@cre4ture cre4ture requested a review from sylvestre March 30, 2024 20:48
@sylvestre sylvestre merged commit c99e1c6 into uutils:main Mar 30, 2024
naoNao89 added a commit to naoNao89/coreutils that referenced this pull request Oct 17, 2025
Add proper retry loops for ErrorKind::Interrupted in I/O operations
to handle signals like SIGUSR1 that can interrupt read/write calls.

This pattern is proven in production - identical to PR uutils#6025 (merged
March 2024) which fixed dd's EINTR handling for GNU test dd/stats.sh.
The same pattern is already used in 9+ utilities (head, tail, tee, wc,
sort, sum, tr, shuf, dd) without issues.

Changes:
- cat: Fix write_fast() and write_lines() to retry on EINTR
- od: Fix PartialReader::read() in all three read paths
- comm: Fix are_files_identical() for both file readers
- tests: Add InterruptingReader/Writer test utilities

Historical context:
- Pattern validated by cre4ture's PR uutils#6025 (dd EINTR fix)
- Matches existing implementations in dd/dd.rs:450,881
- POSIX best practice for signal-interrupted I/O

Fixes uutils#1275
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