fix(comfyui): stop the converger orphaning the runtime it cannot kill #892
No reviewers
Labels
No labels
burndown-2026-06
burndown-2026-08
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/advocate
role/director
role/exec
role/frontend
role/gamedev
role/human
role/platform
role/qa
role/science
role/sysadmin
state
ambient
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/infrastructure!892
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/comfyui-orphan-on-refused-restart"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #883 in part. The S4U placement question in #888 is untouched and still open.
The defect
The restart guard added in #890 runs
Stop-ScheduledTaskbefore it checks whether the loopback port can be freed:On an S4U host the kill is always refused. The runtime sits in session 0, the converger runs unelevated in session 1, so
Stop-Processcannot touch it. The sequence becomes: detach the runtime from its task, discover the port is still held, then throw a message claiming the runtime was left alone.It was not left alone. It was orphaned. That false message is why this reads as a safe failure.
Why it matters more than the failure it replaced
#890 fixed the loud symptom, where a converge left a dead endpoint. What is left is quieter. The endpoint keeps answering, so an operator reads "left alone" and believes nothing changed, while the task sits
Readywith no instance forRestartCount=5to act on and a logon-only trigger. The next time that python exits, nothing recovers it until someone logs in.This is also where the orphaned runtimes in #883 come from. A converge run against a live S4U runtime manufactures one every time and reports success at leaving it alone.
Measured on kai-tower-3026, 23:30 PDT
Serving normally, supervised by nothing.
The change
Free the port first. A refused kill now leaves a supervised runtime and a throw that is true.
Stop-ScheduledTaskmoves below the guard and stays ahead of the start, becauseMultipleInstances IgnoreNewwould drop a start while the old instance is alive.Four lines moved, no behavior change on a host where the kill succeeds.
Verification
Parsed clean with
[Parser]::ParseFile(3215 tokens). PSScriptAnalyzer is not installed on this host.Not verified live, deliberately. Exercising this path means running the converger against the live ComfyUI, which is the destructive act at the center of #883. The current runtime is already an orphan and recovering it needs an elevated stop of pid 39132 before
Start-ScheduledTask, which drops the endpoint for one startup. That wants an operator who knows nothing is mid-render, so I left it for a live-collab pass rather than doing it to prove a four-line reorder.