Generator functions bail on retry-able exceptions
- Dominant language
- Python
- Stars
- 165
- Forks
- 71
- PR merge metrics
- No merged PRs in 30d
Description
For tracking purposes.
The original v1 version of `Requester` included an additive backoff/retry loop for `execute_request()`. This logic does not appear to have been ported to the v2 `Requester` class. Unfortunately, `HTTPError(429)` and `URLError(Timeout)` both can raise exceptions that will interrupt an iteration in progress. Because we want to allow uninterrupted iteration over things like `Incident.list()`, any applicable retries should occur before raising these exceptions.
This retry logic is especially pertinent for multi-threading, as (for example) a parent thread may iterate over `incidents`, while child threads iterate over `log_entries`. There should be an expectation that rapid requests from the child, causing HTTP 429, should not raise an exception in the parent thread iterator as it does today.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the v2 Requester implementation and its execute_request() path, then compare it with the original v1 retry loop described in the issue. Exercise Incident.list() while triggering HTTPError(429) and URLError(Timeout); done means applicable retries occur before exceptions interrupt iteration, including when nested requests run across threads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100