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: README.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,6 +173,56 @@ Notes:
173
173
- If neither Skyflow common credentials nor individual configuration-level credentials are provided, the SDK attempts to retrieve credentials from the `SKYFLOW_CREDENTIALS` environment variable.
174
174
- All Vault operations require a client instance.
175
175
176
+
### Configure timeouts and retries
177
+
178
+
You can control how long a request is allowed to run and whether failed requests are retried. These settings can be applied client-wide (to all vaults) on `Skyflow.builder()`, or per vault on `VaultConfig`.
179
+
180
+
| Setting | Unit | Default | Description |
181
+
| --- | --- | --- | --- |
182
+
|`timeout`| seconds |`60`| Overall time budget for a request, including any retries and backoff. |
183
+
|`maxRetries`| count |`0`| Number of retry attempts. `0` disables retries. |
184
+
|`initialRetryDelayMillis`| milliseconds |`500`| Base delay before the first retry. |
185
+
|`maxRetryDelayMillis`| milliseconds |`2000`| Upper bound on the delay between retries. |
186
+
187
+
Each setting is available at two levels:
188
+
189
+
-**Client-wide** — on `Skyflow.builder()`: `.timeout(int)`, `.maxRetries(int)`, `.initialRetryDelayMillis(long)`, `.maxRetryDelayMillis(long)`. Applies to every vault.
190
+
-**Per vault** — on `VaultConfig`: `.setTimeout(int)`, `.setMaxRetries(int)`, `.setInitialRetryDelayMillis(long)`, `.setMaxRetryDelayMillis(long)`. Applies to that vault only.
191
+
192
+
**Precedence:** a value set on `VaultConfig` (per vault) overrides the client-wide value set on `Skyflow.builder()`, which overrides the SDK default. Resolution is per field, so a vault can override just `timeout` and still inherit the client-wide retry settings.
193
+
194
+
**Retry behavior:** when `maxRetries` is greater than `0`, the SDK retries requests that fail with HTTP `408`, `429`, or `5xx`, using exponential backoff with jitter between `initialRetryDelayMillis` and `maxRetryDelayMillis`. It also honors the `Retry-After` and `X-RateLimit-Reset` response headers. Retries are disabled by default so non-idempotent writes are not automatically retried; enable them explicitly when appropriate.
195
+
196
+
**Timeouts:** when a request exceeds `timeout`, the SDK surfaces an error with HTTP status `408` and the message `Request timed out.`.
197
+
198
+
```java
199
+
importcom.skyflow.Skyflow;
200
+
importcom.skyflow.config.VaultConfig;
201
+
202
+
// Per-vault configuration: these settings override the client-wide values for this vault only.
.initialRetryDelayMillis(500L) // base backoff in milliseconds
218
+
.maxRetryDelayMillis(2000L) // backoff cap in milliseconds
219
+
.addVaultConfig(vaultConfig)
220
+
.build();
221
+
222
+
// Result for this vault: timeout=30, maxRetries=3, initialRetryDelayMillis=1000, maxRetryDelayMillis=4000
223
+
// (all overridden per vault). A vault that sets none of these inherits the client-wide values above.
224
+
```
225
+
176
226
# Vault
177
227
178
228
The [Vault](https://github.com/skyflowapi/skyflow-java/tree/main/src/main/java/com/skyflow/vault) module performs operations on the vault, including inserting records and detokenizing tokens.
0 commit comments