Repository navigation
fix(platform): repeat a gateway call its busy store turned away - #3975
Merged
Merged
Conversation
The gateway keeps its config in SQLite and answers a write that collides with another one with a 500: right after it starts, while it syncs its own catalogs, and under concurrent writes such as a revoke beside a budget move. At 8 concurrent model-endpoint requests, 9 of 64 key revokes and 7 of 64 budget moves failed that way, and a session started just after a gateway restart could fail its provisioning; an image admission whose cap move failed was refused. Every management call now goes through one client that sends a call again, after 250, 750 and 2000 ms, when the answer names the locked store, or for GET, PUT and DELETE on any 5xx. A POST answered otherwise returns at once, since it may have created what it asked for. Live: the same load and three provisions right after a restart then failed nothing.
This was referenced Sep 30, 2026
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.
Why
The model gateway keeps its configuration in SQLite, and SQLite refuses a write that collides with another write. The gateway then answers the call with a 500 "database is locked". This happens in two situations:
The platform's sweeps retry revokes later. A failed cap move, however, refuses the turn's image generation.
What changes
Every management call now goes through one client in
llm_gateway_admin.ts, which also owns the admin credentials and the per-attempt timeout. A call answered with a 5xx is sent again after 250 ms, 750 ms and 2000 ms, but only where that is safe:Verified