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

retry on "reduce your request rate" #865

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Changes from 1 commit
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
7 changes: 5 additions & 2 deletions s3fs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,13 @@ async def _error_wrapper(func, *, args=(), kwargs=None, retries):
except ClientError as e:
logger.debug("Client error (maybe retryable): %s", e)
err = e
wait_time = asyncio.sleep(min(1.7**i * 0.1, 15))
martindurant marked this conversation as resolved.
Show resolved Hide resolved
if "SlowDown" in str(e):
await asyncio.sleep(min(1.7**i * 0.1, 15))
await wait_time
elif "reduce your request rate" in str(e):
await wait_time
elif "XAmzContentSHA256Mismatch" in str(e):
await asyncio.sleep(min(1.7**i * 0.1, 15))
await wait_time
else:
break
except Exception as e:
Expand Down