Skip to content

Commit 8835ef2

Browse files
committed
updated docs
1 parent 45f8c60 commit 8835ef2

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- feat: Retry-After header value exposed in error objects for better observability
99

1010
### Changed
11-
- **BREAKING**: Default maximum retry count increased from 3 to 15
11+
- **BREAKING**: Maximum allowable retry count is now enforced at 15 (default remains 3)
1212
- **BREAKING**: State-affecting operations (POST, PUT, PATCH, DELETE) now only retry on 5xx errors when Retry-After header is present
1313
- **BREAKING**: FgaError now exposes Retry-After header value via getRetryAfterHeader() method
1414

@@ -22,7 +22,7 @@
2222
**Migration Guide**:
2323
- Review retry behavior for state-affecting operations - they now require Retry-After header for 5xx retries
2424
- Update error handling code if using FgaError properties - new getRetryAfterHeader() method available
25-
- Consider adjusting maxRetries configuration if relying on previous default of 3
25+
- Note: Maximum allowable retries is now enforced at 15 (validation added to prevent exceeding this limit)
2626

2727
## v0.8.3
2828

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ fgaClient.writeAssertions(assertions, options).get();
965965
966966
### Retries
967967
968-
The SDK implements RFC 9110 compliant retry behavior with support for the `Retry-After` header. By default, the SDK will automatically retry failed requests up to **15 times** with intelligent delay calculation.
968+
The SDK implements RFC 9110 compliant retry behavior with support for the `Retry-After` header. By default, the SDK will automatically retry failed requests up to **3 times** with intelligent delay calculation (maximum allowable: 15 retries).
969969
970970
#### Retry Behavior
971971
@@ -978,12 +978,17 @@ The SDK implements RFC 9110 compliant retry behavior with support for the `Retry
978978
#### Delay Calculation
979979
980980
1. **Retry-After header present**: Uses the server-specified delay (supports both integer seconds and HTTP-date formats)
981-
2. **No Retry-After header**: Uses exponential backoff with jitter (base delay: 2^retryCount * 500ms, capped at 120 seconds)
981+
2. **No Retry-After header**: Uses exponential backoff with jitter (base delay: 2^retryCount * 100ms, capped at 120 seconds)
982982
3. **Minimum delay**: Respects the configured `minimumRetryDelay` as a floor value
983983
984984
#### Configuration
985985
986-
Customize retry behavior using the `ClientConfiguration` builder:
986+
Customize retry behavior using the `ClientConfiguration` builder. The SDK enforces a maximum of 15 retries to prevent accidental server overload:
987+
988+
**⚠️ Breaking Changes:**
989+
- State-affecting operations (POST, PUT, PATCH, DELETE) now only retry 5xx errors when a `Retry-After` header is present
990+
- Configuration validation now prevents setting `maxRetries` above 15
991+
- `FgaError` now exposes the `Retry-After` header value via `getRetryAfterHeader()`
987992
988993
```java
989994
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -997,7 +1002,7 @@ public class Example {
9971002
.apiUrl(System.getenv("FGA_API_URL")) // If not specified, will default to "http://localhost:8080"
9981003
.storeId(System.getenv("FGA_STORE_ID")) // Not required when calling createStore() or listStores()
9991004
.authorizationModelId(System.getenv("FGA_MODEL_ID")) // Optional, can be overridden per request
1000-
.maxRetries(15) // retry up to 15 times on API requests (default: 15)
1005+
.maxRetries(3) // retry up to 3 times on API requests (default: 3, maximum: 15)
10011006
.minimumRetryDelay(100); // minimum wait time between retries in milliseconds (default: 100ms)
10021007

10031008
var fgaClient = new OpenFgaClient(config);

0 commit comments

Comments
 (0)