Repository navigation
fix(logs): bound throttling backoff and recover the polling interval - #9404
vinsymoyya wants to merge 4 commits into
Conversation
|
Thanks @vinsymoyya, this is a clean fix and the tests are solid. One thing I'd like to see in this PR, since X-Ray is in the stated scope. The X-Ray's throttle arrives under a different error code. It's if error_code in ("ThrottlingException", "ThrottledException"):A botocore Other non-blocking:
Separately, and not for this PR: a |
vicheey
left a comment
There was a problem hiding this comment.
Thanks @vinsymoyya! The develop merge after #9413 dropped the X-Ray half of the fix: the throttle branch in xray_event_puller.py still does += 1 then **= 2, so only the reset-on-success survived. The new X-Ray cases in test_tail_backoff.py and the trace/service-graph test_with_throttling_* tests fail on the current head. Could you re-apply the bounded doubling there, keeping #9413's ("ThrottlingException", "ThrottledException") check and its "Next poll in %s seconds" message?
|
Restored bounded doubling in 4327e78, preserving #9413's Added service graphs to the shared backoff matrix and used each service's actual throttle code. All 183 observability/log-command tests pass. Full Linux |
Which issue(s) does this change fix?
Fixes #9403.
Why is this change necessary?
CloudWatch and X-Ray tailers repeatedly square their polling interval after throttling. Five throttles at the default interval lead to a 65,536-second delay, and successful polls never restore the original interval.
How does it address the issue?
Double the interval up to 60 seconds and restore the configured interval after a successful poll, including an empty response. Preserve explicitly configured intervals longer than 60 seconds. Apply the policy to CloudWatch Logs and the shared X-Ray trace/service-graph tail loop, and document it in their constructor docstrings.
Add twelve regression cases for sustained throttling, recovery and custom intervals across CloudWatch Logs, X-Ray traces and X-Ray service graphs, using each service's actual throttle code. Update existing CloudWatch, trace and service-graph throttling expectations to the bounded doubling policy. Preserve #9413’s support for both X-Ray throttle codes and its "Next poll in %s seconds" warning.
What side effects does this change have?
After throttling, tailing retries sooner than the previous unbounded delays. Successful polling resumes the normal interval. SDK request parameters, event delivery and CLI options are unchanged.
Validation
make pron Linux/Python 3.11: 9,855 tests passed, 28 skipped, 59 subtests passed, 94.19% coverage. Schema generation, Black, Ruff and mypy (1,394 source files) passed.Mandatory Checklist
make prpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.