aistore.sdk.retry_manager
aistore.sdk.retry_manager
Module Contents
Classes
Data
API
Manages applying the retry configuration along with any custom logic to requests.
Parameters:
Sends requests without a retry wrapper to the configured AIS endpoint
Retry configuration, containing config for both tenacity retry logic and logic for cold gets from remote backend providers.
Return the retry config provided to this manager
Hook called by Tenacity before sleeping between retries. Determine if we want to delay the retry. If so, use LockPoller to poll until the object is unlocked.
Parameters:
Retry state from tenacity.
Compose network_retry with the cold-get write-lock polling hook.
If we get a read timeout, it’s possible AIS is currently downloading and writing a remote object, so our initial request failed to acquire a read lock.
Retrying immediately means we expect AIS to be finished downloading from remote, which may take longer than our default retry.
Returns: Whether to delay tenacity retry.
Parameters:
Original exception.
Validated request that produced exc.
Why tenacity.retry over urllib3.Retry?
urllib3.Retry always retries the same failing URL, which is problematic if a target is down or restarting.
Instead, we retry at this stage with tenacity to re-create the initial request to the proxy URL.
This request will then get redirected to the latest selected target.
Parameters:
Function that makes a request to AIS and returns a requests.Response object.
Args for request_func.
Kwargs for request_func.
Returns: Response
Response object from the provided request_func.