fix(registry): kill process tree on timeout to prevent zombie reg.exe#105
Merged
fix(registry): kill process tree on timeout to prevent zombie reg.exe#105
Conversation
When registry scan/fix operations timed out, Node.js killed only the root cmd.exe process but left reg.exe children running as orphans. On systems with large registries this caused 100+ zombie processes, 100% CPU usage, and confusing errors showing raw %__KA0% placeholders. Three root causes addressed: 1. Process tree killing: execNativeUtf8 now tracks child processes and uses taskkill /T /F /PID to kill the entire tree on timeout/abort, preventing orphaned reg.exe instances. 2. Cancellation support: Added AbortController to scan and fix operations with Stop buttons in the UI, so users can cancel long-running operations and all child processes are cleaned up. 3. Error message sanitization: %__KAn% env var placeholders in error messages are replaced with actual argument values. Also calls killAllChildren() on app exit (before-quit) as a safety net. Closes #XXX Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
execNativeUtf8now tracks child processes and usestaskkill /T /F /PIDto kill the entire tree (cmd.exe + reg.exe) on timeout or abort, preventing orphanedreg.exeinstances that consumed 100% CPUAbortControllerto registry scan/fix operations with "Stop" buttons in the UI, pluskillAllChildren()on app exit as a safety net%__KAn%environment variable placeholders in error messages are replaced with actual argument values so users see meaningful commandsFixes the issue where registry cleanup spawned 100+ zombie
reg.exeprocesses that persisted after stopping Kudu, caused 100% CPU usage, and showed confusing errors likeCommand failed: cmd.exe /d /v:off /s /c chcp 65001 >/dev/null && reg "%__KA0%" "%__KA1%".Test plan
reg.exeprocesses after scan completes or times outreg.exeprocesses remain%__KA0%placeholdersnpm test— all 1936 tests pass🤖 Generated with Claude Code