Two `wrangler dev` processes started together pick the same inspector port
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
Direzione di ricerca
Start with packages/wrangler/src/api/startDevWorker/ConfigController.ts, especially resolveInspectorConfig, and trace how the inspector port is selected and passed to workerd. Reproduce the race using the linked repro, which starts two wrangler dev processes together with separate --port values. Done means concurrent starts avoid the inspector port collision or report the inspector address and --inspector-port accurately.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What versions & operating system are you using?
wrangler 4.163.0 (miniflare 5.20261116.0-beta, workerd 1.20261116.1), Node 24.21.0, Linux x64.
Please provide a link to a minimal reproduction
https://github.com/onmax/repros/tree/repro/wrangler-inspector-port-race/wrangler-inspector-port-race
Describe the Bug
When two wrangler dev processes start at the same moment, each with its own --port, both pick inspector port 9229 and one of them fails:
✘ [ERROR] Address already in use (socket "direct:1:default"). Please check that you are not already running a server on this address or specify a different port with --port.
This happens in scripts that serve two builds side by side, like a before/after benchmark. The repro starts two Workers together, five times in a row. Every run leaves one process that never answers (6/6 on my machine). Passing a distinct --inspector-port to each (CONTROL=1 pnpm verify) fixes it, 0/4. Started a few seconds apart, the second process moves to 9230 as expected.
The cause looks like a check-then-bind race. resolveInspectorConfig asks get-port for a free port from 9229 up. get-port binds the port, closes it, and returns the number. workerd binds it later, so both processes get 9229 in that window.
The error message makes it harder to find. direct:1:default is the inspector proxy's socket, but nothing says so, and the hint suggests --port, which is already different for each process. Naming the inspector address and --inspector-port in the message would point people to the fix.
Please provide any relevant error logs
See above. With CONTROL=1 both processes start in every run.
- Lingua principale
- TypeScript
- Stelle
- 4.7k
- Fork
- 1.7k
- Merge medio
- 1g 22h
- PR unite (30g)
- 282
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudflare/workers-sdk
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
cloudflare/workers-sdk#17215 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
cloudflare/workers-sdk#17189 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cloudflare/workers-sdk#17187 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
cloudflare/workers-sdk#17175 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
cloudflare/workers-sdk#17174 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cloudflare/workers-sdk
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
earendil-works/pi#12615 ·
I maintainer di solito rispondono entro 1 giorno
-
My Caps shows "Shared" on private Caps that were never sharedForse già presa @AksharP5 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
CapSoftware/Cap#4569 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
OHDSI/Data2Evidence#3749 ·
I maintainer di solito rispondono entro 4 giorni
-
PWA: Unique Page TitlesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Flagsmith/flagsmith-nodejs-client#332 ·
I maintainer di solito rispondono entro 2 giorni