From 97d7cc440b560180f8f7c69d248f08fb58a9c310 Mon Sep 17 00:00:00 2001 From: Vladimir Brik <22751545+vbrik@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:55:51 -0600 Subject: [PATCH] utils.py retry_execute: except HTTP 500 and 503 --- actions/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/actions/util.py b/actions/util.py index 962faef..6e82b89 100644 --- a/actions/util.py +++ b/actions/util.py @@ -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)