BUILD-10777 Add retry with exponential backoff for OIDC and Cognito auth#55
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap the three external calls (GitHub OIDC token, Cognito GetId, Cognito GetCredentials) with retryWithBackoff for transient failure resilience. Add retryOptions to AuthConfig so tests can override delays. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…dential-setup tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7393e09 to
eb6d2d4
Compare
SummaryAdds exponential backoff retry logic to handle transient OIDC and Cognito rate-limit failures. Wraps three independent external calls (GitHub OIDC token fetch, Cognito GetId, Cognito GetCredentials) with a new What reviewers should knowStart with
|
…ring herd Jitter range: 50-100% of base delay. Prevents concurrent runners from retrying in lockstep after a transient outage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SonarQube Remediation AgentSonarQube found 6 issues in this PR that the agent can fix for you. Est. time saved: ~30 min 6 issues found
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… rate limiting Cognito Rate exceeded errors need longer backoff windows. New delays: ~5s first retry, ~10s second retry (with jitter). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…pliance Math.random() flagged as security hotspot (non-CSPRNG). Use node:crypto randomInt instead — same jitter behavior, no SQ finding. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|



Summary
retryWithBackoff()utility with exponential backoff and jittergetCognitoCredentialswith retry: GitHub OIDC token, Cognito GetId, Cognito GetCredentialsForIdentityFixes transient
Rate exceededfailures observed in CI (BUILD-10777).Backoff behavior
Defaults: 3 attempts, 5000ms base delay, exponential with jitter (50-100% of base).
Jitter prevents thundering herd when many concurrent runners retry simultaneously after a transient Cognito rate limit.
Example: a workflow with 20 matrix jobs hits Cognito simultaneously. Without jitter, all 20 retry at exactly 5s, hitting the rate limit again. With jitter, retries spread across 2.5-5s, reducing contention.
Example log output on transient Cognito rate limit:
Defaults are configurable via
AuthConfig.retryOptions(maxAttempts,baseDelayMs).Changes
src/retry.tssrc/auth.ts__tests__/retry.test.ts__tests__/auth.test.ts__tests__/credential-setup.test.tsTest plan
🤖 Generated with Claude Code