fix(controller): platform-aware process table, kill fallbacks, and install-job cancellation#211
Open
luminary19 wants to merge 1 commit into
Open
Conversation
…stall-job cancellation Read the process inventory from CIM (Get-CimInstance Win32_Process, UTF-8) on Windows and from ps elsewhere, so orphan-worker discovery and docker-container matching work cross-platform. Kill fallbacks use taskkill /T /F on win32 and skip the meaningless sudo attempt; install-job cancellation kills the child tree; the running-process python probe reads the command line via CIM and tokenizes it with the shared quote-aware splitter. POSIX behavior is unchanged.
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 discovery ran
ps, kill fallbacks ransudo -n kill, and installcancel signalled only the direct child — all no-ops or leaks on Windows. The
process inventory now goes through a platform seam:
Get-CimInstance Win32_Process(UTF-8, JSON) on win32, the existingpspath elsewhere, withcommand lines tokenized by the shared quote-aware splitter instead of split on
spaces. Kill fallbacks use
taskkill /PID <pid> /T /Fon win32 and skip themeaningless
sudoattempt; install-job cancellation kills the child tree; therunning-process python probe reads the command line via CIM on Windows. POSIX
paths are unchanged. Fixes #210.
Validation
bun run typecheckandbun run lintclean; the newparseWindowsProcessInventoryunit test passes. Verified live on Windows 11that
listProcessInventory()returns the real CIM process table (377 processes,correct pid/ppid, quoted command paths tokenized). The POSIX branch is
byte-identical to the previous
listProcessInventory(Linux takes the unchangedpspath), so CI is unaffected.Note: the existing
process-manager-spawnintegration suite has Windows-onlyfixture issues (extensionless fake binaries, a POSIX-shaped orphan-sweep
expectation) that are addressed by the separate test-portability PR; on Linux CI
that suite runs the unchanged POSIX path and passes.
UI changes
None.
Risks / rollout notes
snapshot is cached for the poll tick to avoid repeated forks.
taskkill /Fis a hard kill — used only where SIGKILL was already theintent.