Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better handle 502 errors when merging PRs #739

Open
chdsbd opened this issue Oct 1, 2021 · 1 comment · May be fixed by #740
Open

better handle 502 errors when merging PRs #739

chdsbd opened this issue Oct 1, 2021 · 1 comment · May be fixed by #740
Labels
bug Something isn't working

Comments

@chdsbd
Copy link
Owner

chdsbd commented Oct 1, 2021

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:

try:
res.raise_for_status()
except http.HTTPError:
log.warning("github api request error", res=res, exc_info=True)
return None

We should audit all of our API requests to ensure we gracefully handle errors.

@chdsbd chdsbd added the bug Something isn't working label Oct 1, 2021
@chdsbd
Copy link
Owner Author

chdsbd commented Oct 4, 2021

Why do we raise ApiCallException for some errors but not others?

# we raise an exception to retry this request.
raise ApiCallException(
method="pull_request/update_branch",
http_status_code=res.status_code,
response=res.content,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant