You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Give the S3 filesystem its own default retry codes #1375
The filesystem gets its own default S3 retry codes, separate from Athena's. When the retry policy of a connection is still the default, the S3 codes are added. A policy that the user configured is used as given.
The default RetryConfig retries THROTTLING_ERROR_CODES (util.py:56), which are Athena's codes. With one injected error each, PyAthena's layer made 2 attempts on ThrottlingException, and 1 attempt on S3's SlowDown (OSError(EBUSY)), ServiceUnavailable (OSError(EBUSY)), InternalError (OSError(EIO)), and RequestTimeout (TimeoutError). Only botocore retries S3 errors, so stop_retries_on and unstoppable_retries govern no S3 retry by default. docs/filesystem.md:482 says only that requests are "sent with the retry policy".
To decide in the PR
The exact codes, and how the two retry layers (botocore and PyAthena) compose in attempts and elapsed time; the docs state both.
Codes. The S3 codes are SlowDown, ServiceUnavailable, InternalError, and RequestTimeout. botocore's retry rules for S3 also retry each of them in both legacy and standard modes: status 500 and 503, and RequestTimeout.
When they are added. They are added when the policy's exceptions equal the default codes (THROTTLING_ERROR_CODES), even if other fields such as attempt changed. A policy whose exceptions the user set to other codes is used as given. Today RetryConfig cannot tell a default policy from an explicit RetryConfig(), so exceptions=THROTTLING_ERROR_CODES given explicitly also gets the S3 codes. The docs state this.
Attempts and waits. The S3 codes use the attempts and waits of the same policy: by default 8 attempts, with waits that sum to 127 seconds plus jitter. botocore retries these errors within each attempt, according to the client's retry mode (5 attempts in legacy, the default, and 3 in standard). The docs describe how the two layers combine.
Activity
laughingman7743 commentedon Nov 12, 2026
Decision (2026-11-13)
The points left to the PR are now settled:
SlowDown,ServiceUnavailable,InternalError, andRequestTimeout. botocore's retry rules for S3 also retry each of them in bothlegacyandstandardmodes: status 500 and 503, andRequestTimeout.exceptionsequal the default codes (THROTTLING_ERROR_CODES), even if other fields such asattemptchanged. A policy whoseexceptionsthe user set to other codes is used as given. TodayRetryConfigcannot tell a default policy from an explicitRetryConfig(), soexceptions=THROTTLING_ERROR_CODESgiven explicitly also gets the S3 codes. The docs state this.legacy, the default, and 3 instandard). The docs describe how the two layers combine.The PR for this issue implements the decision.
Send a stream body from its starting position on each retry (GH-1375)
Rewind a stream body bound by a partial too (GH-1375)
Merge pull request #1400 from pyathena-dev/fix/1375-s3-retry-codes