Repository navigation
Add retries with exponential backoff for GitHub API calls - #96109
Conversation
GitHub GraphQL API occasionally returns transient errors like "Something went wrong while executing your query". Add retries with exponential backoff (capped at 60 seconds) to handle these: - `Shell.run`: add backoff sleep between retries - `GH.do_command_with_retries`: replace fixed 5s sleep with backoff - `pr_labels_and_category.py`: retry `gh pr edit` up to 5 times - `merge_sync_pr.py`: retry `gh pr ready`/`gh pr merge` up to 5 times - `check_ci.py`: retry `gh pr ready`/`gh pr merge` up to 5 times Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Workflow [PR], commit [2646faa] Summary: ❌
|
Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
@maxknv, this is finished and ready for review! |
|
@maxknv, we need it because GitHub is very unstable. |
I set it as a draft to finish it myself. Implementation is not really good. Some files should not be changed, in some places, it interferes with existing retry functionality |
It’s the first time I’ve seen this error. I also checked other failures in this job that uses the GH CLI intensively; all of them are not GitHub-related. I’d say the gh CLI works reliably, and most issues with the GitHub API come from the checkout step, which is not related to this change anyway. Based on the linked report, there was indeed an unexpected error returned from GitHub, but there’s no evidence that it happens occasionally or that retries would help avoid it. I’m OK to merge with some edits (i'll make them) in the code, but please no rush. |
The retry mechanism in `Shell.check` was sleeping before checking if the error was retryable. This wasted time on non-retryable errors. Now checks error type first, then only sleeps if retry is warranted. Also removed explicit `retries=5` from `gh pr` commands in `check_ci` as they now rely on default retry behavior. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
|
Thanks for the fixes, super appreciated! |
GitHub GraphQL API occasionally returns transient errors like "Something went wrong while executing your query". Add retries with exponential backoff (capped at 60 seconds) to handle these:
Shell.run: add backoff sleep between retriesGH.do_command_with_retries: replace fixed 5s sleep with backoffpr_labels_and_category.py: retrygh pr editup to 5 timesmerge_sync_pr.py: retrygh pr ready/gh pr mergeup to 5 timesChangelog category (leave one):
@maxknv, see here: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96015&sha=c71f3c4a5279f70b0f2bed0d8a8ebde3ca00ab18&name_0=PR
#96015
Version info
26.2.1.333