Repository navigation
ci: reap stray Lemonade processes before starting the server - #1946
Conversation
Self-hosted stx/strix-halo runners reuse the same machine across jobs, so a crashed or leaked Lemonade Server from a prior job keeps listening on 13305. The next job's inline `lemonade-server serve` then dies with `[Errno 10048] only one usage of each socket address` (bind collision on ::1:13305), and a leaked llama-server child keeps a model resident so the next /load returns "llama-server failed to start". This is the recurring red on Test Lemonade Embeddings API and RAG Integration Tests. Add installer/scripts/cleanup-lemonade.ps1 — frees the port (IPv4+IPv6 owners), reaps stray Lemonade/llama-server processes by name, then blocks until the port is free so the caller's bind succeeds. start-lemonade.ps1 now reuses it (single source of truth); the inline-start workflows (embeddings, rag, api) call it between install and start.
|
Verdict: Approve This PR fixes the spurious red checks on the embeddings/RAG/API workflows by reaping stray Lemonade and 🔍 Technical detailsIssuesNone blocking. 🟢 Name-based reap can hit a concurrent job ( Verified
Strengths
|
Why this matters
Five of the current open PRs show the same red checks — Test Lemonade Embeddings API and RAG Integration Tests — and none of them are code failures. On the self-hosted
stx/strix-halorunners the machine is reused across jobs, so a crashed or leaked Lemonade Server from a prior job keeps listening on port 13305. The next job's Lemonade start then dies with[Errno 10048] only one usage of each socket address(a bind collision on::1:13305), and any leakedllama-serverbackend child keeps a model resident so the next/loadreturnsllama-server failed to start. The result is spurious failures that force repeated manual re-runs.After this change the port is freed and stray Lemonade/
llama-serverprocesses are reaped before each server start, so the bind is deterministic.start-lemonade.ps1already had a weaker version of this (port-owner kill only); the inline-start workflows (embeddings, rag, api) had no cleanup at all — which is exactly where the collisions came from.The cleanup lives in one script (
installer/scripts/cleanup-lemonade.ps1) reused by bothstart-lemonade.ps1and the inline workflows, so there's a single source of truth. It frees IPv4 and IPv6 listeners (the collision was on::1), reaps orphans by name, and blocks until the port is actually free.Test plan
cleanup-lemonade.ps1parses cleanly (PowerShell AST parser) and runs idempotently — verified locally it kills a live server holding 13305, then is a clean no-op when the port is free.start-lemonade.ps1parses cleanly after the refactor; the&call keeps its$ErrorActionPreference='Stop'intact (child scope).