better handle 502 errors when merging PRs
chdsbd opened this issue · comments
When Kodiak starts merging a PR, it enters a loop, polling until the PR is ready to merge. If Kodiak makes a GitHub API request and encounters an error, it will eject from this loop, ignoring the PR and moving on to the next PR in queue.
This is problematic behavior as it can trigger extra updates to PRs. We should gracefully retry on recoverable errors.
Here's where we check for an error:
kodiak/bot/kodiak/queries/__init__.py
Lines 876 to 880 in afd6e59
We should audit all of our API requests to ensure we gracefully handle errors.
Why do we raise ApiCallException for some errors but not others?
kodiak/bot/kodiak/pull_request.py
Lines 262 to 268 in b6b543d