Skip to content

Retry throttled bootstrap data requests - #282

Open
Wenxuan W (wenxuan0923) wants to merge 1 commit into
Azure:mainfrom
wenxuan0923:wenx/retry-bootstrap-data-429
Open

Retry throttled bootstrap data requests#282
Wenxuan W (wenxuan0923) wants to merge 1 commit into
Azure:mainfrom
wenxuan0923:wenx/retry-bootstrap-data-429

Conversation

@wenxuan0923

Copy link
Copy Markdown
Collaborator

Summary

  • retry listBootstrapData when AKS RP returns HTTP 429
  • honor Retry-After and add exponential full jitter to spread concurrent Flex Node retries
  • bound retries to 12 hours with coverage for a 30k-node subscription bucket drain
  • refresh the ARM access token before each retry and stop promptly on context cancellation
  • drain throttled response bodies so HTTP connections remain reusable

Context

AKS RP is adding subscription-scoped throttling to listBootstrapData with a 100-request burst and one-token-per-second refill. Without client retries, a throttled first-boot request exits before writing bootstrap data and the node does not join.

Validation

  • go test ./...
  • go vet ./...
  • go test -race ./pkg/bootstrapdata
  • golangci-lint run --timeout=5m (v2.13.0)
  • git diff --check

Copilot AI lite review requested due to automatic review settings August 20, 2026 04:31
@github-actions

Copy link
Copy Markdown

Thanks for the contribution! This pull request comes from a fork, so the Azure E2E workflow is intentionally skipped for security reasons.

Merge will remain blocked until the E2E tests have been run from a branch in the Azure/AKSFlexNode repository by a maintainer/contributor with access to this repo.

Maintainer options:

  1. Review the fork changes.
  2. Push the trusted commit to a branch in Azure/AKSFlexNode.
  3. Run the E2E Tests workflow from that same-repository branch, or open a same-repository PR so the workflow can run automatically.

We do not run Azure E2E directly from fork PR code because it requires Azure OIDC access.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds resilient client-side handling for AKS RP subscription-scoped throttling on listBootstrapData, so FlexNode nodes can successfully join even when the first bootstrap-data request receives HTTP 429 responses.

Changes:

  • Add bounded retry logic for HTTP 429 responses, honoring Retry-After and applying exponential full jitter to spread concurrent retries.
  • Refresh ARM access tokens before each retry and stop retrying promptly on context cancellation/deadlines.
  • Add unit tests covering retry behavior, token refresh, Retry-After parsing, and retry budget constraints.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/bootstrapdata/bootstrap_data.go Implements 429 retry loop with jittered backoff, Retry-After parsing, and token refresh per retry.
pkg/bootstrapdata/bootstrap_data_test.go Adds test coverage for throttling retries, deadlines/cancellation, and Retry-After/backoff behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +289 to +296
if response.StatusCode != http.StatusTooManyRequests || retry == maxRetries {
return response, nil
}

delay := throttleRetryDelay(response.Header.Get("Retry-After"), retry, time.Now(), deps.jitter)
if deadline, ok := ctx.Deadline(); ok && time.Until(deadline) <= delay {
return response, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants