Skip to content

Commit 8705320

Browse files
committed
fix(ports): preserve unknown port-probe status as fail-closed error
- When checkPortInUse returns "unknown" (all probes failed for non-EADDRINUSE reasons), isPortBusy now throws instead of silently returning false - This prevents forceFreePortAndWait from treating an indeterminate probe as "port is free" and skipping cleanup
1 parent c8fac5a commit 8705320

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/cli/ports.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ function killPortWithFuser(port: number, signal: "SIGTERM" | "SIGKILL"): PortPro
132132

133133
async function isPortBusy(port: number): Promise<boolean> {
134134
const status = await checkPortInUse(port);
135+
if (status === "unknown") {
136+
throw new Error(`Cannot determine port ${port} status: all probe attempts failed`);
137+
}
135138
return status === "busy";
136139
}
137140

0 commit comments

Comments
 (0)