From ba8d176340e0e77ad31b31373925e9ee63c46333 Mon Sep 17 00:00:00 2001 From: Adam Ladachowski Date: Thu, 12 Feb 2026 22:05:51 +0000 Subject: [PATCH] Fix wait_ready crashing after sd-server binds port during model load Only ConnectError was caught, so once the port opened but the model was still loading, health check timeouts (ReadTimeout) and connection resets (ReadError) would crash the polling loop instead of retrying. Co-Authored-By: Claude Opus 4.6 --- tensors/server/process.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tensors/server/process.py b/tensors/server/process.py index 7d0cb51..babde7e 100644 --- a/tensors/server/process.py +++ b/tensors/server/process.py @@ -29,7 +29,7 @@ class ProcessManager: def build_cmd(self) -> list[str]: if self.config is None: raise RuntimeError("No config set") - cmd = [SD_SERVER_BIN, "-m", self.config.model, "--port", str(self.config.port)] + cmd = [SD_SERVER_BIN, "-m", self.config.model, "--listen-port", str(self.config.port)] cmd.extend(self.config.args) return cmd @@ -65,6 +65,8 @@ class ProcessManager: "running": True, "pid": self.proc.pid, "model": self.config.model if self.config else None, + "port": self.config.port if self.config else None, + "bind": f"http://127.0.0.1:{self.config.port}" if self.config else None, "cmd": self.build_cmd(), } @@ -82,7 +84,7 @@ class ProcessManager: r = await client.get(url, timeout=2) if r.status_code == _HTTP_OK: return True - except httpx.ConnectError: + except (httpx.ConnectError, httpx.TimeoutException, httpx.ReadError): pass await asyncio.sleep(1) return False