Fix a cold start failing when the model server loses its port to a passing connection#543
Merged
Merged
Conversation
The fleet picks each member's port at start, but llama-swap only spawns the member on its first request, so the port sits unclaimed for the whole lazy wait and a passing ephemeral connection can take it. The server then exits "couldn't bind HTTP server socket", llama-swap masks it as "exited prematurely", and the client classified every such death as CONNECTION: the sole replica got written off as unhealthy and the request failed with "no healthy replica", even though llama-swap re-spawns on the next request and normally binds fine (the occupier is gone within seconds). When the upstream's captured tail shows the bind failure, classify the death as SERVER instead, so the existing retry_on_busy backoff re-drives the spawn. Any other exit reason keeps the CONNECTION failover path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A model server could fail its first request with "The model server is not responding and no healthy replica is available" on a machine with busy ports. The fleet picks each member's port at start, but llama-swap only spawns the member on its first request, so the port sits unclaimed for the whole wait and a passing connection can take it. The server exits "couldn't bind HTTP server socket", and the client wrote the replica off as dead even though the next spawn binds fine seconds later. This failed a release verify run's ingest.
Solution
When the dead member's captured output shows the bind failure, classify the death as transient instead of dead-replica, so the existing busy-retry backoff re-drives llama-swap's spawn. Every other exit reason keeps the failover path.