Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable retries in botocore. #970

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pynamodb/connection/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,10 @@ def _make_api_call(self, operation_name: str, operation_kwargs: Dict, settings:
operation_model,
)

for i in range(0, self._max_retry_attempts_exception + 1):
# FIXME: actually remove the loop if we decide to keep this patch
for i in range(0, 1):
attempt_number = i + 1
is_last_attempt_for_exceptions = i == self._max_retry_attempts_exception
is_last_attempt_for_exceptions = True

http_response = None
prepared_request = None
Expand Down Expand Up @@ -532,7 +533,9 @@ def client(self):
parameter_validation=False, # Disable unnecessary validation for performance
connect_timeout=self._connect_timeout_seconds,
read_timeout=self._read_timeout_seconds,
max_pool_connections=self._max_pool_connections)
max_pool_connections=self._max_pool_connections,
retries={'mode': 'standard', 'max_attempts': self._max_retry_attempts_exception},
)
self._client = self.session.create_client(SERVICE_NAME, self.region, endpoint_url=self.host, config=config)
return self._client

Expand Down