Skip to content

Commit

Permalink
Increase total_max_attempts on boto3 api retries (#813)
Browse files Browse the repository at this point in the history
* use adaptive retries

* only change max attempts, not mode

* comment

* remove mode

* lint

---------

Co-authored-by: Siddharth Manoj <[email protected]>
  • Loading branch information
2 people authored and areitz committed Nov 29, 2023
1 parent f87e8d2 commit 61a2642
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion baseplate/sidecars/live_data_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,17 @@ def _load_from_s3(data: bytes) -> bytes:
# resource is public. In other words, this means that a given service cannot access
# a public resource belonging to another cluster/AWS account unless the request credentials
# are unsigned.

# Access S3 with 10 max retries enabled:
s3_client = boto3.client(
"s3",
config=Config(signature_version=UNSIGNED),
config=Config(signature_version=UNSIGNED, retries={"total_max_attempts": 10}),
region_name=region_name,
)
else:
s3_client = boto3.client(
"s3",
config=Config(retries={"total_max_attempts": 10}),
region_name=region_name,
)

Expand Down

0 comments on commit 61a2642

Please sign in to comment.