Skip to content

fix: back off on X-Ray ThrottledException - #9413

Merged
vicheey merged 1 commit into
aws:developfrom
vinsymoyya:fix/xray-throttle-code
Nov 14, 2026
Merged

vicheey merged 1 commit into
aws:developfrom
vinsymoyya:fix/xray-throttle-code

Conversation

@vinsymoyya

Copy link
Copy Markdown
Contributor

Which issue(s) does this change fix?

Related to #9403; follows up on the review of #9404.

Why is this change necessary?

X-Ray reports ThrottledException (HTTP 429) for GetTraceSummaries, BatchGetTraces, and GetServiceGraph. Tailing currently recognizes only ThrottlingException, so real X-Ray throttles terminate the tail instead of backing off.

How does it address the issue?

  • Recognize both throttle codes in the shared X-Ray puller, preserving existing compatibility.
  • Add botocore Stubber regressions for all three X-Ray operations and test both error codes in the existing trace and service-graph tests.
  • Cover AccessDeniedException after a throttle across CloudWatch, X-Ray traces, and service graphs, asserting the original error escapes without an extra sleep.
  • Describe the next poll delay in warnings, which remains accurate when fix(logs): bound throttling backoff and recover the polling interval #9404 caps the interval.

The six new regression cases produce five failures and one pass on unmodified develop: all three real X-Ray API throttles are re-raised, and both X-Ray error-sequence cases stop at the throttle.

Validation: Full Linux/Python 3.11 make pr passed: 9,777 tests, 28 skipped, 94.14% coverage, with formatting, linting, and type checks passing. Locally, all 171 observability/logs tests and type checks passed; the resolved combination with #9404 passed 179 affected tests.

What side effects does this change have?

This PR targets current develop independently of #9404 and does not duplicate its bounded-backoff changes. Both PRs edit adjacent lines in the X-Ray error handler, so the second to merge will need a small conflict resolution. The resolved combination passed all 179 affected tests locally. Interruptible waits remain a separate follow-up. No dependency or public-interface changes.

Mandatory Checklist

  • Review the generative AI contribution guidelines
  • Add input/output type hints to new functions/methods
  • Write design document if needed (not needed for this focused correction)
  • Write/update unit tests
  • Write/update integration tests (SDK-boundary cases use botocore Stubber; live AWS tests are not needed)
  • Write/update functional tests if needed (not needed)
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed (not needed)
  • Write documentation (behavior explained above; no command or configuration changes)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@vinsymoyya
vinsymoyya requested a review from a team as a code owner November 9, 2026 02:10
@github-actions github-actions Bot added pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Nov 9, 2026
LOG.warning(
"Throttled by CloudWatch Logs API, consider pulling logs for certain resources. "
"Increasing the poll interval time for resource %s to %s seconds",
"Next poll for resource %s in %s seconds",

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.

Thank you for improvement.

@vicheey
vicheey merged commit 0cfc34e into aws:develop Nov 14, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants