fix(port): change default port to 18080, handle Windows excluded TCP ranges#757
fix(port): change default port to 18080, handle Windows excluded TCP ranges#757livepeer-tessa wants to merge 1 commit intomainfrom
Conversation
…ge handling Port 52178 can fall inside Windows 11's OS-reserved TCP excluded ranges (visible via `netsh int ipv4 show excludedportrange protocol=tcp`), causing Scope to hang at startup with 'No available ports found after 5 attempts'. Changes: - Change DEFAULT_PORT from 52178 to 18080, which sits well outside both the Windows dynamic port range (49152-65535) and known exclusion blocks - Increase findAvailablePort maxAttempts from 5 to 50 - Add jump-ahead logic: after 10 consecutive failures, skip 200 ports to escape a wide OS-excluded block more quickly - Simplify error handling in isPortAvailable (all errors = port unavailable) Fixes #606, reported by @viborc and confirmed by @Tobe2d Signed-off-by: livepeer-robot <robot@livepeer.org>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 fal.ai Preview Deployment
Livepeer Runner
TestingConnect to this preview deployment by running this on your branch: Livepeer mode: 🧪 E2E tests will run automatically against this deployment. |
✅ E2E Tests passed
Test ArtifactsCheck the workflow run for screenshots. |
Problem
Scope hangs at startup on Windows 11 with:
Root cause: Port
52178(and the 4 ports after it) can fall inside Windows 11's OS-reserved TCP excluded ranges. These ranges are not "in use" in the traditional sense — no process is bound there — but Windows prevents binding to them entirely. This is common on machines with certain hardware (RTX 5090 etc.) that registers port exclusions at the driver level.You can check your machine's excluded ranges with:
The old
findAvailablePortonly tried 5 consecutive ports, which wasn't nearly enough to escape a wide exclusion block (e.g. 52085–52184).Fix
DEFAULT_PORTfrom52178to18080— sits well outside both the Windows dynamic ephemeral range (49152–65535) and known exclusion blocks near the high endmaxAttemptsfrom 5 → 50 — more headroom for fallbackisPortAvailableerror handling — all socket errors (EADDRINUSE, EACCES, ENOBUFS, etc.) correctly returnfalseTesting
Closes #606