Bind serve's socket before writing client.json
A serve that lost the port race had already signed in, so client.json named a port another engine held and every client talked to that one. The socket is now bound first and handed to uvicorn. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QgG6TJw5qBZzaLghQSRVrq
This commit is contained in:
+2
-1
@@ -53,7 +53,8 @@ The default port moves out of the way when something already has it (8001,
|
||||
8002, and so on) and says which one it took; the URL written to
|
||||
`client.json` is the one it is actually on. A port you *asked* for is never
|
||||
moved off: `--port 9000` on a taken 9000 fails, because something else is
|
||||
there and you named it.
|
||||
there and you named it. It fails before `client.json` is written, so every
|
||||
client keeps talking to the engine that is actually up.
|
||||
|
||||
What it will *not* do is start a second engine for the same instance. Before
|
||||
anything else, `serve` looks for an engine already serving this directory —
|
||||
|
||||
Reference in New Issue
Block a user