Skip to content

Commit badb82e

Browse files
committed
feat: retry query jobs if jobBackendError or jobInternalError are encountered
1 parent abc319b commit badb82e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

google/cloud/bigquery/retry.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ def _should_retry_get_job_conflict(exc):
124124
"rateLimitExceeded",
125125
"backendError",
126126
"internalError",
127+
"jobBackendError",
128+
"jobInternalError",
127129
"jobRateLimitExceeded",
128130
)
129131

@@ -153,6 +155,11 @@ def _job_should_retry(exc):
153155
# waiting for the query to complete.
154156
if _should_retry(exc):
155157
return True
158+
159+
# Per b/436586523, ML/AI jobs don't seem to populate the structured errors
160+
# reason. If these jobs fail, still try to retry them.
161+
if "job encountered an internal error" in str(exc):
162+
156163

157164
if not hasattr(exc, "errors") or len(exc.errors) == 0:
158165
return False

0 commit comments

Comments
 (0)