Skip to content

Commit 9c25071

Browse files
committed
add retry to efs apis on throttling
1 parent 4514b1d commit 9c25071

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ assignees: ''
2222
### Environment Details
2323
#### Desktop (please complete the following information):
2424
- **OS**: [e.g. iOS]
25-
- **GCS Version** [e.g. 0.0.1 or commit ID]
25+
- **Code Version** [e.g. 0.0.1 or commit ID]
2626
- **Python Version** [e.g. python 3.9.16]

src/aibs_informatics_aws_utils/efs/core.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
from pathlib import Path
1313
from typing import TYPE_CHECKING, Dict, List, Optional, Union
1414

15+
from aibs_informatics_core.utils.decorators import retry
1516
from aibs_informatics_core.utils.tools.dicttools import remove_null_values
17+
from botocore.exceptions import ClientError
1618

17-
from aibs_informatics_aws_utils.core import AWSService
19+
from aibs_informatics_aws_utils.core import AWSService, client_error_code_check
1820

1921
if TYPE_CHECKING: # pragma: no cover
2022
from mypy_boto3_efs.type_defs import (
@@ -40,7 +42,10 @@
4042

4143
StrPath = Union[Path, str]
4244

45+
throttling_exception_callback = lambda ex: client_error_code_check(ex, "ThrottlingException")
4346

47+
48+
@retry(ClientError, [throttling_exception_callback])
4449
def list_efs_file_systems(
4550
file_system_id: Optional[str] = None,
4651
name: Optional[str] = None,
@@ -111,6 +116,7 @@ def get_efs_file_system(
111116
return file_systems[0]
112117

113118

119+
@retry(ClientError, [throttling_exception_callback])
114120
def list_efs_access_points(
115121
access_point_id: Optional[str] = None,
116122
access_point_name: Optional[str] = None,

0 commit comments

Comments
 (0)