perf: process kill retry, PID jitter, daemon runtime#627
Open
perf: process kill retry, PID jitter, daemon runtime#627
Conversation
- Add process.wait() after kill() to verify termination and prevent zombie processes - Add +/-20% random jitter to PID file polling interval to prevent thundering herd when multiple kild create commands run simultaneously - Switch daemon from multi-threaded tokio runtime to current_thread since it's I/O-bound with low concurrency (PTY reads + IPC) Closes #478
- Replace process.wait() with bounded 500ms poll loop to avoid blocking indefinitely on uninterruptible sleep - Use PID-based jitter instead of SystemTime nanos which are correlated across simultaneous launches - Revert current_thread runtime: daemon multiplexes PTYs + IPC across multiple sessions, single-threaded would stall all sessions on any slow operation
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.
Summary
process.wait()afterkill()to verify termination and prevent zombie processeskild createcommands run simultaneouslycurrent_threadsince it's I/O-bound with low concurrencyItems 1 (Cow newtypes), 2 (git caching — each call opens a different worktree path), and 6 (HashMap keys are tiny pane IDs) from #478 were evaluated and skipped as YAGNI for this codebase.
Closes #478
Test plan
cargo fmt --checkpassescargo clippy --all -- -D warningspassescargo test --allpasses (2 pre-existing failures inresolve_self_branchunrelated to this PR)kild create+kild stopto verify process cleanupkild createcommands to verify jitter prevents lock contention