Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit e3fd5d8

Browse filesBrowse files
fix: retry cancelled errors (#1235)
There's an internal race condition where when an rpc hits the timeout limit, it sometimes receives a DEADLINE_EXCEEDED, but sometimes receives a CANCELLED error. This PR marks CANCELLED as retryable, so this situation will always eventually reach a DEADLINE_EXCEEDED state. This will fix the flake currently seen in the conformance tests
1 parent 044efe7 commit e3fd5d8
Copy full SHA for e3fd5d8

6 files changed

+8-2Lines changed: 8 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎google/cloud/bigtable/data/_async/client.py‎

Copy file name to clipboardExpand all lines: google/cloud/bigtable/data/_async/client.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
from google.api_core.exceptions import DeadlineExceeded
6060
from google.api_core.exceptions import ServiceUnavailable
6161
from google.api_core.exceptions import Aborted
62+
from google.api_core.exceptions import Cancelled
6263
from google.protobuf.message import Message
6364
from google.protobuf.internal.enum_type_wrapper import EnumTypeWrapper
6465

@@ -938,6 +939,7 @@ def __init__(
938939
DeadlineExceeded,
939940
ServiceUnavailable,
940941
Aborted,
942+
Cancelled,
941943
),
942944
default_mutate_rows_retryable_errors: Sequence[type[Exception]] = (
943945
DeadlineExceeded,
Collapse file

‎google/cloud/bigtable/data/_sync_autogen/client.py‎

Copy file name to clipboardExpand all lines: google/cloud/bigtable/data/_sync_autogen/client.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
from google.api_core.exceptions import DeadlineExceeded
5050
from google.api_core.exceptions import ServiceUnavailable
5151
from google.api_core.exceptions import Aborted
52+
from google.api_core.exceptions import Cancelled
5253
from google.protobuf.message import Message
5354
from google.protobuf.internal.enum_type_wrapper import EnumTypeWrapper
5455
import google.auth.credentials
@@ -729,6 +730,7 @@ def __init__(
729730
DeadlineExceeded,
730731
ServiceUnavailable,
731732
Aborted,
733+
Cancelled,
732734
),
733735
default_mutate_rows_retryable_errors: Sequence[type[Exception]] = (
734736
DeadlineExceeded,
Collapse file

‎tests/unit/data/_async/test_client.py‎

Copy file name to clipboardExpand all lines: tests/unit/data/_async/test_client.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,7 @@ def test_table_ctor_sync(self):
13341334
core_exceptions.DeadlineExceeded,
13351335
core_exceptions.ServiceUnavailable,
13361336
core_exceptions.Aborted,
1337+
core_exceptions.Cancelled,
13371338
],
13381339
),
13391340
(
@@ -1832,7 +1833,6 @@ async def test_read_rows_retryable_error(self, exc_type):
18321833
@pytest.mark.parametrize(
18331834
"exc_type",
18341835
[
1835-
core_exceptions.Cancelled,
18361836
core_exceptions.PreconditionFailed,
18371837
core_exceptions.NotFound,
18381838
core_exceptions.PermissionDenied,
Collapse file

‎tests/unit/data/_async/test_mutations_batcher.py‎

Copy file name to clipboardExpand all lines: tests/unit/data/_async/test_mutations_batcher.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,7 @@ def test__add_exceptions(self, limit, in_e, start_e, end_e):
11691169
core_exceptions.DeadlineExceeded,
11701170
core_exceptions.ServiceUnavailable,
11711171
core_exceptions.Aborted,
1172+
core_exceptions.Cancelled,
11721173
],
11731174
),
11741175
(
Collapse file

‎tests/unit/data/_sync_autogen/test_client.py‎

Copy file name to clipboardExpand all lines: tests/unit/data/_sync_autogen/test_client.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,7 @@ def test_ctor_invalid_timeout_values(self):
10631063
core_exceptions.DeadlineExceeded,
10641064
core_exceptions.ServiceUnavailable,
10651065
core_exceptions.Aborted,
1066+
core_exceptions.Cancelled,
10661067
],
10671068
),
10681069
(
@@ -1507,7 +1508,6 @@ def test_read_rows_retryable_error(self, exc_type):
15071508
@pytest.mark.parametrize(
15081509
"exc_type",
15091510
[
1510-
core_exceptions.Cancelled,
15111511
core_exceptions.PreconditionFailed,
15121512
core_exceptions.NotFound,
15131513
core_exceptions.PermissionDenied,
Collapse file

‎tests/unit/data/_sync_autogen/test_mutations_batcher.py‎

Copy file name to clipboardExpand all lines: tests/unit/data/_sync_autogen/test_mutations_batcher.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,7 @@ def test__add_exceptions(self, limit, in_e, start_e, end_e):
10211021
core_exceptions.DeadlineExceeded,
10221022
core_exceptions.ServiceUnavailable,
10231023
core_exceptions.Aborted,
1024+
core_exceptions.Cancelled,
10241025
],
10251026
),
10261027
(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.