fabro/lib/crates
Bryan Helmkamp 4c4d4efcda
fix(cli): detect zombies in server stop poll loop
The `foreground_start_writes_tracing_to_storage_server_log` test
consistently took ~10.4 s. 10.3 s of that was spent inside `fabro
server stop`, which polls `process_running(pid)` every 100 ms until
the server exits. The test's server is spawned as a child of the test
process (`child.spawn()`), and the test only reaps it via
`child.wait_with_output()` after `fabro server stop` returns. After
Step A's revert, `process_running` is a plain `kill(pid, 0)`, which
returns true for a zombie — so the poll saw the dead-but-unreaped
server as alive and burned the full 10 s timeout.

Add `fabro_proc::process_running_strict(pid)` — the same
ps-shelling zombie-aware predicate commit 1ed8e6cbd introduced — and
use it only in `fabro-cli`'s server stop poll. The hot paths that
motivated Step A (test-harness marker scans, daemon-liveness probes)
continue to use the cheap `process_running`.

The ps cost (~2 ms per call) is paid at most once per 100 ms poll
interval and only while the server process still exists. In a normal
clean shutdown that's zero calls (process exits before the first
poll). In the zombie scenario the loop exits after ~1 poll instead
of running out the full timeout.

Verified on this branch:

  cargo nextest run -p fabro-cli -E 'test(foreground_start_writes_tracing)'
  before: 10.48s, 10.45s, 10.42s
  after:  0.35s,  0.32s,  0.25s (30x faster)

The zombie regression test removed in commit da87f978c returns as
`process_running_strict_returns_false_for_unreaped_zombie_child`,
and also asserts that the cheap `process_running` keeps its
"zombie == alive" semantics so the harness hot paths stay honest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 17:39:52 -04:00
..
fabro-agent refactor(unwrap): clear non-test workspace warnings 2026-04-19 20:56:38 -04:00
fabro-api refactor(cli): rename ServerStoreClient -> Client, fabro_api::Client -> ApiClient 2026-04-20 08:56:09 -04:00
fabro-auth Merge remote-tracking branch 'origin/main' 2026-04-19 20:32:02 -04:00
fabro-checkpoint lint(clippy): disallow blocking std::fs on Tokio paths 2026-04-19 17:22:21 -04:00
fabro-cli fix(cli): detect zombies in server stop poll loop 2026-04-20 17:39:52 -04:00
fabro-config feat(server): add explicit GitHub webhook strategies 2026-04-19 22:53:22 -04:00
fabro-core refactor(unwrap): clean runtime hotspot call sites 2026-04-19 20:48:44 -04:00
fabro-devcontainer refactor(unwrap): clear non-test workspace warnings 2026-04-19 20:56:38 -04:00
fabro-github refactor(server): relocate github helpers and use macros for test context 2026-04-20 08:39:12 -04:00
fabro-graphviz refactor(unwrap): clear non-test workspace warnings 2026-04-19 20:56:38 -04:00
fabro-hooks refactor(unwrap): clear non-test workspace warnings 2026-04-19 20:56:38 -04:00
fabro-http fix(auth): harden loopback checks and align CSP tests 2026-04-20 13:30:45 -04:00
fabro-install lint(clippy): disallow blocking std::fs on Tokio paths 2026-04-19 17:22:21 -04:00
fabro-interview Merge remote-tracking branch 'origin/main' 2026-04-19 20:32:02 -04:00
fabro-llm test(unwrap): clean shared support and workflow fixtures 2026-04-19 21:01:25 -04:00
fabro-macros refactor(settings): stage 6.3b shrink server runtime types + delete Combine 2026-04-09 18:27:46 -04:00
fabro-mcp fix: simplify fabro-http crate and fix correctness issues 2026-04-12 12:20:55 -04:00
fabro-model chore(clippy): require reasons on allow attributes 2026-04-19 20:24:24 -04:00
fabro-oauth Merge remote-tracking branch 'origin/main' 2026-04-20 09:47:47 -04:00
fabro-proc fix(cli): detect zombies in server stop poll loop 2026-04-20 17:39:52 -04:00
fabro-retro ci: switch clippy to pinned nightly, clean up workspace lints 2026-04-16 18:59:11 -04:00
fabro-sandbox refactor(unwrap): clear non-test workspace warnings 2026-04-19 20:56:38 -04:00
fabro-server test: de-flake pr_list and full_http_lifecycle_cancel 2026-04-20 15:04:08 -04:00
fabro-slack refactor(http): centralize reqwest behind fabro-http 2026-04-12 11:48:54 -04:00
fabro-spa Merge remote-tracking branch 'origin/main' 2026-04-20 09:33:08 -04:00
fabro-store refactor(auth): simplify CLI auth plumbing after code review 2026-04-20 11:13:37 -04:00
fabro-telemetry Merge remote-tracking branch 'origin/main' 2026-04-19 20:32:02 -04:00
fabro-template refactor(async): lint std::process::Command across all targets 2026-04-12 13:35:57 -04:00
fabro-test test(harness): collapse live_marker_count match into matches! 2026-04-20 16:38:28 -04:00
fabro-tracker refactor(unwrap): clear non-test workspace warnings 2026-04-19 20:56:38 -04:00
fabro-types Merge remote-tracking branch 'origin/main' 2026-04-20 09:47:47 -04:00
fabro-util refactor(unwrap): clear non-test workspace warnings 2026-04-19 20:56:38 -04:00
fabro-validate fmt: apply nightly rustfmt after merge 2026-04-11 13:43:30 -04:00
fabro-vault lint(clippy): disallow blocking std::fs on Tokio paths 2026-04-19 17:22:21 -04:00
fabro-workflow test(unwrap): clean shared support and workflow fixtures 2026-04-19 21:01:25 -04:00