Skip to content

Commit

Permalink
utils.py retry_execute: except HTTP 500 and 503
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrik committed Jan 22, 2024
1 parent 0110806 commit 97d7cc4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions actions/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ def retry_execute(request, max_attempts=8):
continue
except HttpError as e:
exception_history.append(e)
if e.status_code in (400, 412):
if e.status_code in (400, 412, 500, 503):
# Both 400 (bad request) and 412 (precondition failed) could be caused
# by a prerequisite resource not being ready, so retrying makes sense.
# by a prerequisite resource not being ready.
# 503 (service unavailable) could be transient
# 500 (internal error) could be transients
continue
else:
raise RetryError(sleep_time_history, exception_history)
Expand Down

0 comments on commit 97d7cc4

Please sign in to comment.