aistore.sdk.lock_poller
aistore.sdk.lock_poller
Module Contents
Classes
Data
API
Best-effort delay for tenacity retries on read-timeouts during a cold GET.
When a remote-bucket GET request times out, the most likely cause is that an
in-flight cold-get is holding the object’s write lock while it streams
from the remote backend (e.g., s3).
This poller asks the cluster whether the object is currently write-locked.
If locked, it polls check-lock with a size-scaled exponential backoff
until the object is unlocked or max_cold_wait expires.
This routes all polling requests to the original configured AIStore endpoint for the provided RequestExecutor.
Parameters:
Pre-configured executor used for sending requests to AIS
Configuration determining how to poll AIS for cold-get status
Build a tenacity Retrying that re-calls a bool-returning function
as long as it keeps returning True (i.e. the object stays locked),
with a size-scaled exponential backoff capped at max_cold_wait.
Fresh HEAD via the configured RequestExecutor to retrieve the object size for scaling the poll backoff. Returns 0 on any failure (so the poller falls back to the minimum backoff bounds).
HEAD on a cold-get with write-lock held should fail to load local object metadata. It will fall back to previous cached attributes if the object exists (lock is a new update).
POST check-lock via the configured RequestExecutor.
Returns: True iff the target replied 423 (write-locked). False on any other status or on transport error; the caller will then stop delaying and let the outer tenacity retry continue.
Delay until the object referenced by the failed request is no longer write-locked (i.e. any in-flight cold-get has released its lock).
Parameters:
Request made to AIS target before receiving the initial error.