Skip to content

Commit 322cefa

Browse files
chore(debug): log socket owners when ports persist (ss -ltnp)
1 parent 0ac7668 commit 322cefa

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

federated-css-react-ssr/scripts/start-exposes.cjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ async function ensurePortFree(port, timeoutMs = 15000) {
3636
while (Date.now() - start < timeoutMs) {
3737
if (!isPortInUse(port)) return;
3838
forceKillPort(port);
39+
try {
40+
const diag = execSync(`ss -ltnp | grep :${port} || true`, { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
41+
if (diag) console.log(`[exposes] port ${port} still in use -> ${diag}`);
42+
} catch {}
3943
await delay(500);
4044
}
4145
}

federated-css-react-ssr/scripts/start-shells.cjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ async function ensurePortFree(port, timeoutMs = 15000) {
3636
while (Date.now() - start < timeoutMs) {
3737
if (!isPortInUse(port)) return;
3838
forceKillPort(port);
39+
try {
40+
const diag = execSync(`ss -ltnp | grep :${port} || true`, { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
41+
if (diag) console.log(`[shells] port ${port} still in use -> ${diag}`);
42+
} catch {}
3943
await delay(500);
4044
}
4145
}

federated-css/scripts/start-all.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ async function ensurePortFree(port, timeoutMs = 15000) {
2929
while (Date.now() - start < timeoutMs) {
3030
if (!isPortInUse(port)) return;
3131
forceKillPort(port);
32+
try {
33+
const diag = execSync(`ss -ltnp | grep :${port} || true`, { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
34+
if (diag) {
35+
console.log(`[federated-css] port ${port} still in use -> ${diag}`);
36+
}
37+
} catch {}
3238
await delay(500);
3339
}
3440
}

0 commit comments

Comments
 (0)