Skip to content

Commit

Permalink
Add UNKNOWN status code to retryable Quantum Engine errors (#6565)
Browse files Browse the repository at this point in the history
* Add UNKNOWN status code to retryable errors.

* Update test

* Revert unintended changes.

* More removals.

* Lint formatting
  • Loading branch information
wcourtney authored Apr 18, 2024
1 parent 2eb6d63 commit 21986dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions cirq-google/cirq_google/engine/stream_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
RETRYABLE_GOOGLE_API_EXCEPTIONS = [
google_exceptions.InternalServerError,
google_exceptions.ServiceUnavailable,
google_exceptions.Unknown, # 408 Timeouts sometimes show up as UNKNOWN.
]


Expand Down
2 changes: 1 addition & 1 deletion cirq-google/cirq_google/engine/stream_manager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ async def test():
[
google_exceptions.InternalServerError('server error'),
google_exceptions.ServiceUnavailable('unavailable'),
google_exceptions.Unknown('timeout'),
],
)
@mock.patch.object(quantum, 'QuantumEngineServiceAsyncClient', autospec=True)
Expand Down Expand Up @@ -403,7 +404,6 @@ async def test():
google_exceptions.TooManyRequests('too many requests'),
google_exceptions.Unauthenticated('unauthenticated'),
google_exceptions.Unauthorized('unauthorized'),
google_exceptions.Unknown('unknown'),
],
)
@mock.patch.object(quantum, 'QuantumEngineServiceAsyncClient', autospec=True)
Expand Down

0 comments on commit 21986dd

Please sign in to comment.