The SDK's token-exchange path fails immediately on the first non-success response from the token endpoint (/v1/auth/jwt), with no retry. A brief, transient server-side error (e.g. a momentary 500) therefore fails the caller outright, even though an immediate re-attempt would succeed.
Ask: retry token exchange on transient failures before giving up.
- Retry on
5xx responses and transport errors (connection/read errors).
- Do not retry on
4xx (bad/expired credentials are not transient).
- Use a small bounded retry budget with exponential backoff + jitter (e.g. 2-3 attempts).
- Apply to both the initial mint and the refresh path.
- Return the final error once retries are exhausted, preserving the last status/body.
For parity, this should match the equivalent change in sdk-python (filed alongside this).
Context on the server-side transient errors that motivated this: hotdata-dev/monopoly#1128.
The SDK's token-exchange path fails immediately on the first non-success response from the token endpoint (
/v1/auth/jwt), with no retry. A brief, transient server-side error (e.g. a momentary500) therefore fails the caller outright, even though an immediate re-attempt would succeed.Ask: retry token exchange on transient failures before giving up.
5xxresponses and transport errors (connection/read errors).4xx(bad/expired credentials are not transient).For parity, this should match the equivalent change in
sdk-python(filed alongside this).Context on the server-side transient errors that motivated this: hotdata-dev/monopoly#1128.