From dbcf15a2acfcc00e30ec0dd61f3eebd51a9b5084 Mon Sep 17 00:00:00 2001 From: Quinn Ftw Date: Mon, 2 Feb 2026 15:44:43 -0800 Subject: [PATCH] =?UTF-8?q?chore(config):=20=F0=9F=94=A7=20Update=20deploy?= =?UTF-8?q?ment=20orchestrator=20configuration=20in=20deployment-orchestra?= =?UTF-8?q?tor.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- run/core/deployment-orchestrator.ts | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/run/core/deployment-orchestrator.ts b/run/core/deployment-orchestrator.ts index 5153bf8..37fc039 100644 --- a/run/core/deployment-orchestrator.ts +++ b/run/core/deployment-orchestrator.ts @@ -610,17 +610,17 @@ export class DeploymentOrchestrator { * 2. If still held, send SIGKILL and wait up to 2 seconds * 3. Log results and continue even if cleanup fails */ - private async cleanupOrphanedPorts(deploymentOrder: string[]): Promise { - this.logger.info(`Checking ${deploymentOrder.length} deployments for orphaned ports...`); + private async cleanupOrphanedPorts(_deploymentOrder: string[]): Promise { + // For group deployments (like _platform), the deploymentOrder may only contain + // the group itself which has no services. We need to check ALL deployments + // in the registry to find orphaned processes on any expected port. + const allDeployments = this.deploymentRegistry.getAll(); const orphanedPorts: Array<{ port: number; pid: number; serviceId: string }> = []; - // Phase 1: Discover all orphaned ports - for (const depName of deploymentOrder) { + // Phase 1: Discover all orphaned ports across ALL deployments + for (const depName of allDeployments) { const depManifest = this.deploymentRegistry.get(depName); - if (!depManifest) { - this.logger.debug(`[OrphanCleanup] Deployment '${depName}' not found in registry`); - continue; - } + if (!depManifest) continue; for (const svc of depManifest.services) { if (DOCKER_ONLY_TYPES.has(svc.type)) continue; @@ -630,22 +630,17 @@ export class DeploymentOrchestrator { // If we already have a PID file, normal shutdown handled it const trackedPid = await readPidFile(serviceId); - if (trackedPid !== null) { - this.logger.debug(`[OrphanCleanup] ${serviceId} has PID file (${trackedPid}), skipping`); - continue; - } + if (trackedPid !== null) continue; // Check if an orphaned process is holding this port const portPid = await getPortPid(svc.port); if (portPid) { - this.logger.info(` → Port ${svc.port} (${serviceId}) held by orphan PID ${portPid}`); orphanedPorts.push({ port: svc.port, pid: portPid, serviceId }); } } } if (orphanedPorts.length === 0) { - this.logger.debug('[OrphanCleanup] No orphaned processes found'); return; }