Skip to content

Commit b39af47

Browse files
author
Chris Rossi
authored
fix: retry grpc UNKNOWN errors (#458)
Fixes #310
1 parent 3b5a64a commit b39af47

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

packages/google-cloud-ndb/google/cloud/ndb/_retry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def retry_wrapper(*args, **kwargs):
102102
core_exceptions.ServiceUnavailable,
103103
core_exceptions.InternalServerError,
104104
core_exceptions.Aborted,
105+
core_exceptions.Unknown,
105106
)
106107

107108

packages/google-cloud-ndb/tests/unit/test__retry.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,11 @@ def test_aborted(core_retry):
178178
core_retry.if_transient_error.return_value = False
179179
assert _retry.is_transient_error(error) is True
180180
core_retry.if_transient_error.assert_called_once_with(error)
181+
182+
@staticmethod
183+
@mock.patch("google.cloud.ndb._retry.core_retry")
184+
def test_unknown(core_retry):
185+
error = core_exceptions.Unknown("testing")
186+
core_retry.if_transient_error.return_value = False
187+
assert _retry.is_transient_error(error) is True
188+
core_retry.if_transient_error.assert_called_once_with(error)

0 commit comments

Comments
 (0)