Repository navigation
Conversation
GET /ready returns 503 until the node's cluster has the minimum number of nodes in every region listed in READINESS_MIN_NODES_PER_REGION (e.g. "us-east-1=2,eu-west-1=2"), then 200. Once reached it stays ready, so a region dropping below its minimum later does not take the other nodes out of rotation. After SIGTERM it returns 503, so a load balancer stops sending new connections while the node drains. Unset, /ready is 200 until SIGTERM. The response says only "not ready" (or "shutting down"); what the node waits for is logged, once when it starts waiting, again only when that changes, and once when it is ready, so frequent probes add no log lines. /ready requests follow DISABLE_HEALTHCHECK_LOGGING, as /healthcheck. /healthcheck is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p a node syn removes a member asynchronously when its process exits, so asserting right after stop_supervised raced on a busy runner, and a fake node left by one test could count toward another test's region. Each test now uses a region of its own, and the latch test waits for the node to leave. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
CRAP Score Report |
This branch has not been deployed
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.
What kind of change does this PR introduce?
A new, opt-in readiness endpoint,
GET /ready, that holds a node out of rotation until its cluster has a minimum number of nodes in every listed region.What is the current behavior?
/healthcheckreturns 200 as soon as the node serves HTTP, and keeps returning 200 while it drains after SIGTERM. In a release where a new set of nodes forms its own cluster, those nodes can take traffic before every region has nodes in the new cluster. Tenants mapped to a region with no node yet are then served from another region.What is the new behavior?
READINESS_MIN_NODES_PER_REGION, e.g.us-east-1=2,eu-west-1=2:/readyreturns 503not readyuntil the node's cluster has at least that many nodes in each listed region, counted from theRegionNodesscope (the node itself included). Then it returns 200.shutting down./readyreturns 200 until SIGTERM./healthcheckdoesn't change./readyrequests followDISABLE_HEALTHCHECK_LOGGING, like/healthcheck, and a 503 from/readyis logged at info, not error.Realtime.Env.get_key_positive_integer_list/1).Backward compatibility
Opt-in. With
READINESS_MIN_NODES_PER_REGIONunset or empty, nothing that exists today changes:/healthcheck: unchanged, response and logging alike./ready: new, previously a 404. It returns 200, or 503shutting downafter SIGTERM, and nothing calls it until a health check is pointed at it.Additional context
Realtime.Readiness(thresholds, the latch, SIGTERM, log once per change), the controller, and the env parser.mix teston the touched modules, credo, format, sobelow, dialyzer.REGION. With one region's new nodes held back for 60 s, no node of the new cluster reported ready in either region, and the previous nodes kept serving. Each waiting node logged one line in those 60 s (checked every 5 s), and one more when it turned ready. Once the held region had its minimum, all new nodes turned ready within a few seconds.🤖 Generated with Claude Code
Closes REAL-1370