Skip to content

Commit b3bd120

Browse files
authored
Merge pull request #122 fix check retriable for idempotent error
2 parents 6e42c28 + 5b98a6f commit b3bd120

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Fix error of check retriable error for idempotent operations (error exist since 2.12.1)
2+
13
## 2.12.1 ##
24
* Supported `TYPE_UNSPECIFIED` item type to scheme ls
35
* Fixed error while request iam token with bad content type in metadata

ydb/_errors.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ def check_retriable_error(err, retry_settings, attempt):
4949

5050
if retry_settings.idempotent:
5151
for t in _errors_retriable_slow_backoff_idempotent_types:
52-
return ErrorRetryInfo(
53-
True, retry_settings.slow_backoff.calc_timeout(attempt)
54-
)
52+
if isinstance(err, t):
53+
return ErrorRetryInfo(
54+
True, retry_settings.slow_backoff.calc_timeout(attempt)
55+
)
5556

5657
return ErrorRetryInfo(False, None)
5758

ydb/table_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,9 @@ def check_retriable_error(err_type, backoff):
132132
check_retriable_error(issues.Unavailable, retry_once_settings.fast_backoff)
133133

134134
check_unretriable_error(issues.Error, True)
135+
with mock.patch.object(retry_once_settings, "idempotent", True):
136+
check_unretriable_error(issues.Error, True)
137+
135138
check_unretriable_error(TestException, False)
139+
with mock.patch.object(retry_once_settings, "idempotent", True):
140+
check_unretriable_error(TestException, False)

0 commit comments

Comments
 (0)