Repository navigation
fix(hub,guard): eliminate GET / hostname spawns, sleep hangs, and unreaped children - #1619
Merged
Merged
Conversation
…eaped children Fixes #1607 - Replace per-request `hostname` subprocess spawning in `net::botnet::name()` (hit on every `GET /` and `GET /pair`) with in-process `plat::hub::hostname()` using `libc::gethostname` on Unix and `GetComputerNameExW` on Windows. - Provide a suspend-excluding `awake_s()` clock on both Unix (`Instant`) and Windows (`QueryUnbiasedInterruptTime`), and switch `native/host/src/guard.rs` (`mono_s()`) and `native/guard/src/{plan,run,sys}.rs` (`SleepClock`, `SLEEP_JUMP_S`, `WAKE_GRACE_S`, startup stall and boot deadlines) to use it so standby/sleep wakeups never mark `writer`, `model`, `agents`, or hub boot as hung. - Require a healthy (`well`) health probe in `plan::proven()` before marking a build stable or promoting an update off probation, preventing a failing build from being promoted during wake grace. - Harden `proc.rs`'s `non_test_code` scanner against forward `#[cfg(test)] mod ...;` declarations, `#[cfg(not(test))]` / `#[cfg(all(not(test), ...))]` blocks, intervening attributes, and next-line braces; route `agents/mod.rs` `remake_folder` git spawn through `proc::tokio_cmd(Kind::Local, "git")` with `!crate::copy::on()`; kill and reap `push/apns.rs` `pipe_and_wait` children on stdin write failure; bounded-wait on `child.wait()` after `start_kill()` across all `accounts_io.rs` `claude_read` exit paths; add `.kill_on_drop(true)` to timed-out probe commands (`net/{botnet,listener,tailnet}.rs`, `commands/clone/mod.rs`, `settings/tools_install.rs`); and name/RAII-reap the `--agent-reaper` waiter thread (`agent-reaper-wait`). - Add and strengthen regression tests in `guard.rs` (`WATCHED` timestamp assertion), `net/botnet.rs`, `wire/tests.rs` (concurrent 20-probe burst), `proc.rs`, `push/apns.rs`, `tests/inherited_signals.rs`, and `native/guard/src/plan.rs`. - Migrate two pre-existing `std::env::temp_dir().join(...)` test directories in `native/host/src/data/ext.rs` and `native/host/src/plan/mod.rs` to `crate::plat::tmp::dir(...)` so `native/guard`'s drop-guard check is green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1607
hostnamesubprocess spawning innet::botnet::name()(hit on everyGET /andGET /pair) with in-processplat::hub::hostname()usinglibc::gethostnameon Unix andGetComputerNameExWon Windows.awake_s()clock on both Unix (Instant) and Windows (QueryUnbiasedInterruptTime), and switchnative/host/src/guard.rs(mono_s()) andnative/guard/src/{plan,run,sys}.rs(SleepClock,SLEEP_JUMP_S,WAKE_GRACE_S, startup stall and boot deadlines) to use it so standby/sleep wakeups never markwriter,model,agents, or hub boot as hung.well) health probe inplan::proven()before marking a build stable or promoting an update off probation, preventing a failing build from being promoted during wake grace.proc.rs'snon_test_codescanner against forward#[cfg(test)] mod ...;declarations,#[cfg(not(test))]/#[cfg(all(not(test), ...))]blocks, intervening attributes, and next-line braces; routeagents/mod.rsremake_foldergit spawn throughproc::tokio_cmd(Kind::Local, "git")with!crate::copy::on(); kill and reappush/apns.rspipe_and_waitchildren on stdin write failure; bounded-wait onchild.wait()afterstart_kill()across allaccounts_io.rsclaude_readexit paths; add.kill_on_drop(true)to timed-out probe commands (net/{botnet,listener,tailnet}.rs,commands/clone/mod.rs,settings/tools_install.rs); and name/RAII-reap the--agent-reaperwaiter thread (agent-reaper-wait).guard.rs(WATCHEDtimestamp assertion),net/botnet.rs,wire/tests.rs(concurrent 20-probe burst),proc.rs,push/apns.rs,tests/inherited_signals.rs, andnative/guard/src/plan.rs.std::env::temp_dir().join(...)test directories innative/host/src/data/ext.rsandnative/host/src/plan/mod.rstocrate::plat::tmp::dir(...)sonative/guard's drop-guard check is green.