Skip to content

Commit 21986dd

Browse files
authored
Add UNKNOWN status code to retryable Quantum Engine errors (#6565)
* Add UNKNOWN status code to retryable errors. * Update test * Revert unintended changes. * More removals. * Lint formatting
1 parent 2eb6d63 commit 21986dd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cirq-google/cirq_google/engine/stream_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
RETRYABLE_GOOGLE_API_EXCEPTIONS = [
2828
google_exceptions.InternalServerError,
2929
google_exceptions.ServiceUnavailable,
30+
google_exceptions.Unknown, # 408 Timeouts sometimes show up as UNKNOWN.
3031
]
3132

3233

cirq-google/cirq_google/engine/stream_manager_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ async def test():
364364
[
365365
google_exceptions.InternalServerError('server error'),
366366
google_exceptions.ServiceUnavailable('unavailable'),
367+
google_exceptions.Unknown('timeout'),
367368
],
368369
)
369370
@mock.patch.object(quantum, 'QuantumEngineServiceAsyncClient', autospec=True)
@@ -403,7 +404,6 @@ async def test():
403404
google_exceptions.TooManyRequests('too many requests'),
404405
google_exceptions.Unauthenticated('unauthenticated'),
405406
google_exceptions.Unauthorized('unauthorized'),
406-
google_exceptions.Unknown('unknown'),
407407
],
408408
)
409409
@mock.patch.object(quantum, 'QuantumEngineServiceAsyncClient', autospec=True)

0 commit comments

Comments
 (0)