fix(registry): prevent orphaned reg.exe/powershell processes on timeout#117
Merged
fix(registry): prevent orphaned reg.exe/powershell processes on timeout#117
Conversation
Three bugs caused child processes to accumulate in Task Manager:
1. execNativeUtf8 passed `timeout` to both Node's execFile (which kills
only the parent cmd.exe) and trackChild (which kills the full tree).
Node's timeout won the race, orphaning reg.exe children. Fixed by
removing `timeout` from execFile options so only trackChild handles
it via taskkill /T /F.
2. Task fix operations (disable-task, delete-task) used raw execFileAsync
with no process tracking — hung PowerShell processes were never killed.
Replaced with new execTracked() helper and wired up abort signal.
3. SAFE_TASK_PATH_RE rejected task names containing curly braces (e.g.
GoogleUpdateTaskMachineUA{GUID}), causing "Invalid task path" errors.
Added {} and , to the allowed character class.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
execNativeUtf8where Node's built-inexecFiletimeout killed only the parentcmd.exe, orphaningreg.exechildren. Now onlytrackChildhandles timeouts usingtaskkill /T /Fto kill the full process tree.disable-task,delete-task) by replacing rawexecFileAsyncwith a newexecTracked()helper that provides tree-kill tracking and abort signal support.GoogleUpdateTaskMachineUA{...}) by adding{}and,toSAFE_TASK_PATH_RE.Test plan
reg.exeorpowershell.exeprocesses remain in Task Manager after fixes complete or time out🤖 Generated with Claude Code