fix: enable Octokit throttle retry and SSM adaptive retry under burst#5136
Draft
vegardx wants to merge 1 commit into
Draft
fix: enable Octokit throttle retry and SSM adaptive retry under burst#5136vegardx wants to merge 1 commit into
vegardx wants to merge 1 commit into
Conversation
Two resilience improvements for burst load: 1. Octokit plugin-throttling callbacks now return true (with caps) so rate-limited GitHub API requests are retried instead of immediately failing. Primary: up to 2 retries. Secondary: 1 retry. 2. SSM client switched to adaptive retry mode with maxAttempts=10, giving ~30s of retry budget for PutParameter under throttling. Standard mode (3 attempts, ~3s) is insufficient when multiple concurrent Lambdas write JIT configs during burst. Fixes github-aws-runners#5135
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
Two resilience gaps that compound under burst load:
Octokit throttle plugin never retries —
onRateLimitandonSecondaryRateLimitcallbacks log a warning but don't returntrue, so@octokit/plugin-throttlingthrows immediately instead of retrying after theretryAfterdelay.SSM client uses default retry (
standard, 3 attempts, ~3s budget) — under burst with multiple concurrent Lambdas writing JIT configs via PutParameter, SSM's ~40 TPS limit is easily exceeded andThrottlingExceptionpropagates up, failing the entire batch.Fix
Octokit throttle callbacks return
truewith capsSSM adaptive retry with maxAttempts=10
adaptivemode adds client-side rate-sensing — when the SDK sees ThrottlingException it slows further calls to match the observed budget. 10 attempts gives ~30s of retry budget, which is safe because runners take ~30-50s to boot before reading their JIT config.Changes
lambdas/functions/control-plane/src/github/auth.ts— throttle callbacks returntruewith retry capslambdas/libs/aws-ssm-util/src/index.ts— shared SSM client config with adaptive retryImpact
Fixes #5135
Refs: #5024, #5037