Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

serve: restart() keeps 0.1.38's close() (PR #637 follow-up)

Niko122199fe8b243706
diff --git a/serve/server.py b/serve/server.py
index 2ac7b25d7..95ba6be2a 100644
--- a/serve/server.py
+++ b/serve/server.py
@@ -425,17 +425,10 @@ class StrataEngine:
def restart(self, tries: int = 3):
"""Start the engine again (the same command) after it died; the new process has its own line queue.
- The old process is ended first (close(): QUIT, terminate, kill) - its GPU memory is freed only when it is
- gone, and a new engine started next to it runs out of VRAM and exits before it is ready - and a failed start
- is retried."""
- try:
- self.close()
- except EngineStuck:
- try:
- self.proc.kill()
- self.proc.wait(timeout=120)
- except (subprocess.TimeoutExpired, OSError):
- pass
+ close() ends and waits for the old process first (EngineStuck when it cannot be ended). A start that still
+ exits before READY - a dead engine's VRAM can take a while to come back, notably on ROCm - is retried
+ (PR #637)."""
+ self.close()
info = dict(self.info)
self.starting = True # prepare() answers 503 "starting" meanwhile (#344)
try: