timeout: Implemention for windows - #13363
Conversation
|
GNU testsuite comparison: |
|
how nicely does this play with #13237 ? |
nothing in unix world was changed, just shuffled in diff files, when your PR gets merged I'll just rebase |
|
Nice then. Quite happy we're getting timeout on Windows land. Let me get this reviewed soon-ish. |
Merging this PR will regress 1 benchmark
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | seq_large_integers |
52.8 KB | 81 KB | -34.74% |
| ⚡ | Memory | timeout_quick_exit |
79 KB | 16.2 KB | ×4.9 |
| ⚡ | Simulation | timeout_quick_exit |
197.6 µs | 87.7 µs | ×2.3 |
| ⚡ | Simulation | seq_large_integers |
2 ms | 1.1 ms | +92.83% |
| ⚡ | Memory | sort_general_numeric[200000] |
22.8 MB | 16.7 MB | +36.47% |
| ⚡ | Simulation | seq_formatted |
94.7 ms | 77 ms | +23% |
| ⚡ | Memory | timeout_enforced |
19.4 KB | 16.5 KB | +17.81% |
| ⚡ | Simulation | sort_general_numeric[200000] |
697.5 ms | 625.9 ms | +11.43% |
| ⚡ | Simulation | timeout_enforced |
92.8 µs | 89.4 µs | +3.77% |
| 🆕 | Memory | timer_expiry_latency[0.001] |
N/A | 79.9 KB | N/A |
| 🆕 | Memory | timer_expiry_latency[0.005] |
N/A | 17 KB | N/A |
| 🆕 | Memory | timer_expiry_latency[0.02] |
N/A | 17 KB | N/A |
| 🆕 | Simulation | timer_expiry_latency[0.001] |
N/A | 200.9 µs | N/A |
| 🆕 | Simulation | timer_expiry_latency[0.005] |
N/A | 93.1 µs | N/A |
| 🆕 | Simulation | timer_expiry_latency[0.02] |
N/A | 92.2 µ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 nikolalukovic:fix/6200 (abe0c7d) with main (2adc40e)2
Footnotes
-
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. ↩
-
No successful run was found on
main(bd73c58) during the generation of this report, so 2adc40e was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
Alonely0
left a comment
There was a problem hiding this comment.
This looks super nice, so lots of thanks for the work! If my other PR lands first, we should be able to enable the benchmarks on *nix as well, and I would hope the rebase/merge isn't too bad; it mostly seems that src/uu/timeout/src/platform/unix.rs would get significantly shrunk (since the logic is moven to uucore), and we'd remove the SIGNALED logic from timeout.rs altogether.
This is a lot of code, so I'll read it with fresh eyes again tomorrow or this week. Also btw, thanks for the new benches!
| ] | ||
| # "feat_os_windows" == set of utilities which can be built/run on modern windows platforms | ||
| feat_os_windows = ["feat_Tier1", "stdbuf"] | ||
| feat_os_windows = ["feat_Tier1", "stdbuf", "timeout"] |
There was a problem hiding this comment.
Not sure if we should instead move timeout to tier 1 if we get Windows support.
cc @sylvestre
|
@nikolalukovic please merge/rebase when you have a moment. I have my review pretty much done, so I'll push the comments once the branch is up-to-date so GitHub doesn't have a stroke. |
done |
Alonely0
left a comment
There was a problem hiding this comment.
Well this is awesome. I've spent the last couple of days testing it on my ARM64 Windows box and it's solid.
Other than my three small comments, this is A-OK from me. Thank you lots!
| // table in `uucore::signals`. Kept local so the `process` feature does not | ||
| // depend on the `signals` feature. |
There was a problem hiding this comment.
Tbh it is perfectly acceptable for process to depend on signal. Last time I checked, it was only in use by timeout, anyway. Even so, given it leads to a cleaner codebase, it's okay; especially considering this way we don't hardcode them twice.
| /// terminating a whole group requires a [`Job`]. | ||
| pub fn send_signal_to_console_group(pid: u32, signal: usize) -> io::Result<()> { | ||
| match disposition(signal)? { | ||
| Disposition::Probe | Disposition::Ignore => Ok(()), |
There was a problem hiding this comment.
What is the reason we ignore Probe? Is it not supported by Windows? Asking because we do not do the same in the functions below or above.
There was a problem hiding this comment.
not supported by windows so just noop-ed
| LAST_CTRL_SIGNAL.store(signal, Ordering::Release); | ||
| if let Some(event) = WAKE_EVENT.get() { | ||
| let _ = sys::set_event(event.as_handle()); | ||
| } |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
store then signal order makes sure no harmful race happens, this test shows that https://github.com/uutils/coreutils/pull/13363/changes#diff-adc7cd341abf71518deed5d4bb2273f3b87f56377ee6a4a57bece52be57a32baR557
|
Neat! |
Attempts to fix #6200