Repository navigation
Conversation
Merging this PR will not alter performance1 warning, 1 note
Comparing Footnotes
|
|
GNU testsuite comparison: |
2500857 to
f8f3e0a
Compare
f8f3e0a to
f675084
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
Updates timeout’s Unix signal-wait behavior to avoid stalling when terminal job-control signals are received, aligning behavior more closely with GNU timeout and addressing #12979.
Changes:
- Treat
SIGTTIN/SIGTTOUas “continue waiting” signals in the wait loop. - Expand the signal set used by
timeoutto include additional signals. - Add a Unix-only regression test intended to cover terminal job-control signal handling.
| File | Description |
|---|---|
| tests/by-util/test_timeout.rs | Adds a new Unix-only test exercising timeout behavior under SIGTTIN trapping. |
| src/uucore/src/lib/features/process/unix.rs | Updates wait-loop signal handling and expands the timeout signal set. |
Review effort: Lite
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
2 resolved since last review
Review effort: Lite
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
Withsigwait-style handling, receivingSIGTTIN/SIGTTOU/SIGTSTPhere will consume the signal… · New Hard-coding/bin/shand/bin/catcan make the test fail in environments where those paths don’t… · New This test appears unlikely to exercise the new behavior:trap ... SIGTTINapplies to the shell,… · New
1 resolved since last review
Review effort: Lite
| ts.cmd("/bin/sh") | ||
| .arg("-c") | ||
| .arg(format!("trap 'echo' SIGTTIN; {bin:?} {name} 2 /bin/cat")) |


Previously, the waiting loop would not handle
SIGTTIN,SIGTTOU, and other signals; this was observed on commands that intercepted them ontimeoutif the child process required them for termination (or other behaviors). For example, it would hang onstracewhen the child wascatortee, same as when trapping them on a subshell.Note that this old behavior matched our implementation before the backend changes of my previous PR. Now that we have fine-grained control on signal handling, we can trivially match GNU and resolve the linked issue.
The new behavior matches GNU by continuing to wait on terminal job-control signals and forwarding the others on demand.
Fixes: #12979