File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 34
34
auth_exceptions .TransportError ,
35
35
)
36
36
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
38
43
39
44
40
45
def _should_retry (exc ):
@@ -51,7 +56,7 @@ def _should_retry(exc):
51
56
return reason in _RETRYABLE_REASONS
52
57
53
58
54
- DEFAULT_RETRY = retry .Retry (predicate = _should_retry , deadline = 600.0 )
59
+ DEFAULT_RETRY = retry .Retry (predicate = _should_retry , deadline = _DEFAULT_RETRY_DEADLINE )
55
60
"""The default retry object.
56
61
57
62
Any 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():
125
125
126
126
127
127
def 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
129
129
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