File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 3434 auth_exceptions .TransportError ,
3535)
3636
37- _DEFAULT_JOB_DEADLINE = 60.0 * 10.0 # seconds
37+ _DEFAULT_RETRY_DEADLINE = 10.0 * 60.0 # 10 minutes
38+
39+ # Allow for a few retries after the API request times out. This relevant for
40+ # rateLimitExceeded errors, which can be raised either by the Google load
41+ # balancer or the BigQuery job server.
42+ _DEFAULT_JOB_DEADLINE = 3.0 * _DEFAULT_RETRY_DEADLINE
3843
3944
4045def _should_retry (exc ):
@@ -51,7 +56,7 @@ def _should_retry(exc):
5156 return reason in _RETRYABLE_REASONS
5257
5358
54- DEFAULT_RETRY = retry .Retry (predicate = _should_retry , deadline = 600.0 )
59+ DEFAULT_RETRY = retry .Retry (predicate = _should_retry , deadline = _DEFAULT_RETRY_DEADLINE )
5560"""The default retry object.
5661
5762Any method with a ``retry`` parameter will be retried automatically,
Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ def test_DEFAULT_JOB_RETRY_predicate():
125125
126126
127127def test_DEFAULT_JOB_RETRY_deadline ():
128- from google .cloud .bigquery .retry import DEFAULT_JOB_RETRY
128+ from google .cloud .bigquery .retry import DEFAULT_JOB_RETRY , DEFAULT_RETRY
129129
130- assert DEFAULT_JOB_RETRY ._deadline == 600
130+ # Make sure we can retry the job at least once.
131+ assert DEFAULT_JOB_RETRY ._deadline > DEFAULT_RETRY ._deadline
You can’t perform that action at this time.
0 commit comments