fix: split health endpoint, isolate sequencer, embed lexicons#168
Open
rabble wants to merge 1 commit intoblacksky-algorithms:mainfrom
Open
fix: split health endpoint, isolate sequencer, embed lexicons#168rabble wants to merge 1 commit intoblacksky-algorithms:mainfrom
rabble wants to merge 1 commit intoblacksky-algorithms:mainfrom
Conversation
…at compile time Health endpoint: - Split /xrpc/_health into a fast liveness probe (no DB check) and /xrpc/_health/ready for deep readiness (DB connectivity check). Kubernetes and other orchestrators can use the fast endpoint for liveness probes without hitting the database on every check. Sequencer isolation: - Run the sequencer polling loop on a dedicated OS thread with its own single-threaded tokio runtime. This prevents sequencer DB polling from competing with request-handling tasks on the main tokio runtime, which could cause worker thread exhaustion under load. ID resolver: - Use ServerConfig values (resolver_timeout, cache_state_ttl, cache_max_ttl, plc_url) instead of reading env vars inline. This ensures the resolver respects the configured timeouts and cache TTLs rather than using defaults. Lexicons: - Use include_str!() to embed lexicons.toml at compile time instead of reading from the filesystem at runtime. This removes the requirement to have lexicons.toml present in the working directory, which was fragile in containerized deployments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
/xrpc/_healthendpoint now serves as a fast liveness probe (no database check). A new/xrpc/_health/readyendpoint performs the deep readiness check with DB connectivity verification. This allows Kubernetes liveness probes to use the fast endpoint without hitting the database on every check interval.tokio::spawn(shared worker pool) to a dedicated OS thread with its own single-threaded tokio runtime. This prevents sequencer DB polling from competing with HTTP request handling, avoiding worker thread exhaustion under load.ServerConfigvalues (resolver_timeout, cache_state_ttl, cache_max_ttl, plc_url) for the identity resolver instead of reading raw env vars with defaultNonevalues. This ensures the resolver respects configured timeouts and cache TTLs.include_str!()to embedlexicons.tomlat compile time instead offs::read_to_string()at runtime. This removes the fragile requirement to havelexicons.tomlin the working directory, which was problematic in containerized deployments.Test plan
GET /xrpc/_healthreturns version without database dependencyGET /xrpc/_health/readyreturns version when DB is connected, 503 when notsubscribe_reposWebSocket consumers still receive eventscargo test -p rsky-pdsfor the new lexicon loading testlexicons.tomlin working directory to verify compile-time embedding works🤖 Generated with Claude Code