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
Copy file name to clipboardExpand all lines: docs/source/retries.rst
+24-7Lines changed: 24 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,31 +38,48 @@ For standard buckets, ``gcsfs`` uses a custom retry decorator (``retry_request``
38
38
Hierarchical Namespace (HNS) Buckets
39
39
------------------------------------
40
40
41
-
For HNS buckets, ``ExtendedGcsFileSystem`` utilizes the specialized Storage Control client (``StorageControlAsyncClient``) for folder-level operations (e.g., ``mkdir``, ``rename``).
41
+
For HNS buckets, ``ExtendedGcsFileSystem`` utilizes the specialized Storage Control client (``StorageControlAsyncClient``) for control plane operations (e.g., ``mkdir``, ``rename``, ``get_storage_layout``).
42
42
43
-
- These calls utilize the underlying Google Cloud Python SDK's default retry behavior. Standard ``gcsfs`` retry logic (``retry_request``) is not applied to these control plane calls.
43
+
- These calls utilize retry configuration based on ``google.api_core.retry.AsyncRetry``.
44
44
- **Applicable Methods:**
45
45
- ``get_storage_layout``: Used to determine bucket type.
46
46
- ``create_folder``: Used for ``mkdir``.
47
47
- ``get_folder``: Used for directory metadata and existence checks.
48
48
- ``list_folders``: Used for directory listings (``ls``).
49
49
- ``rename_folder``: Used for moving/renaming directories (``mv``).
50
-
- **Non-Retried Methods:** Methods like ``delete_folder`` (used for ``rmdir``) are not retried by default.
50
+
- ``delete_folder``: Used for deleting directories (``rmdir``, ``rm -r``).
- **Backoff Strategy:** Exponential backoff with ``initial=1.0s``, ``maximum=60.0s``, and ``multiplier=2.0``.
58
-
- **Overall Timeout (Deadline):** 60.0s
58
+
- ``google.api_core.exceptions.Unauthenticated`` (when "Invalid Credentials" is in the message).
59
+
60
+
- **Configuration:**
61
+
The retry behavior can be customized via the following parameters passed to the FileSystem instance:
62
+
63
+
- ``retry_timeout`` (float): The total deadline for the retry loop in seconds. Default: ``60.0``.
64
+
- ``retry_initial`` (float): The initial delay between retries in seconds. Default: ``1.0``.
65
+
- ``retry_maximum`` (float): The maximum delay between retries in seconds. Default: ``60.0``.
66
+
- ``retry_multiplier`` (float): The multiplier applied to the delay after each retry. Default: ``2.0``.
67
+
68
+
Per-attempt timeout is controlled by an internal ``STORAGE_CONTROL_RPC_TIMEOUT`` constant, currently set to ``30.0s``.
69
+
70
+
Configuring Retries via fsspec
71
+
------------------------------
72
+
73
+
Since ``gcsfs`` integrates with the ``fsspec`` configuration system, these retry parameters can be set using ``fsspec`` `configuration files or environment variables <https://filesystem-spec.readthedocs.io/en/latest/features.html#configuration>`_
74
+
75
+
These settings will be automatically picked up by any ``GCSFileSystem`` instance when experimental HNS support is enabled (which is the default).
59
76
60
77
Rapid Storage (Zonal Buckets)
61
78
-----------------------------
62
79
63
80
For Zonal buckets, ``ZonalFile`` utilizes the specialized gRPC clients (``AsyncMultiRangeDownloader`` for reads and ``AsyncAppendableObjectWriter`` for writes).
64
81
65
-
- Similar to HNS buckets, control plane operations for Zonal buckets (such as ``get_storage_layout`` or folder operations) utilize the same ``StorageControlAsyncClient`` retry mechanism described in the HNS section above.
82
+
- Similar to HNS buckets, control plane operations for Zonal buckets (such as ``get_storage_layout`` or folder operations) utilize the same Storage Control retry mechanism described in the **Storage Control API** section above.
66
83
- File read/write operations (data plane) for Zonal buckets utilize the underlying Google Cloud Python SDK's default retry behavior for gRPC streams. Standard ``gcsfs`` retry logic (``retry_request``) is not applied to these data plane calls.
0 commit comments