Repository navigation
Conversation
HOST_LIMITS sets the most live hosts per provider, as JSON. A provider it does not name has no limit. A live host is not in error and has not expired. Warm pool hosts count, because the pool maintainer creates through the same path. create_host takes a Postgres advisory lock keyed by the provider name in the insert transaction, counts the live hosts, and refuses at the limit. A refused create returns 503 with CAPACITY and Retry-After, and leaves no row.
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.
HOST_LIMITSsets the most live hosts per provider, as JSON (for example{"exe": 28, "docker": 6}). A provider that it does not name has no limit.Behavior
create_hosttakespg_advisory_xact_lockkeyed by the provider name, in the transaction that inserts the row. The lock serializes the creates of one provider, so two requests cannot both pass the count.errorand have not expired. Provisioning rows count. Warm pool hosts count, because the pool maintainer creates through the same path.POST /hostsreturns503withCAPACITYandRetry-After: 30. The refused create leaves no row.Checks
exeat its limit refuses,stubwith no limit creates.uv run pytestpasses on SQLite and on Postgres 17 (785 tests).ruff check,ruff format --check, andpyrightpass.