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
feat!: Introduce tiered timeout system with per-endpoint configuration (#653)
## Summary
- Introduce three (four with max) configurable timeout tiers:
- `short` (5s by default),
- `medium` (30s by default),
- `long` (360s by default),
- and `max` (360s cap by default).
- Introduce `Timeout` type alias: `timedelta | Literal['no_timeout',
'short', 'medium', 'long']`
- Keep the exponential timeout growth per retry attempt (doubles each
retry, capped at `timeout_max`).
- The default timeout tiers were kept as they were (let's adjust them
later in a dedicated PR).
- Reduce default max retries from 8 to 4 (5 attempts by default).
- Rename `_internal_models.py` to `_types.py` and consolidate type
aliases (`Timeout`, `JsonSerializable`) into it.
- Remove old timeout constants (`FAST_OPERATION_TIMEOUT`,
`STANDARD_OPERATION_TIMEOUT`).
## Timeout tiers
| Tier | Default | Usage |
|------|---------|-------|
| `short` | 5s | 16 methods (only in storage clients) |
| `medium` | 30s | 7 methods (only in storage clients) |
| `long` | 360s | 150+ (all the others) |
| `no_timeout` | — | It is not used by default |
| `max` | 360s | Cap for exponential timeout growth across retries |
Let's discuss the best defaults later in a dedicated PR.
## What this solves
- Before this change, timeout handling across the client was fragmented
and inconsistent in three major ways:
- Some resource clients had hardcoded internal timeouts.
- Users had no way to control per-request timeouts.
- The timeout parameter name was ambiguous on Actor/Task run methods.
## Test plan
- [x] CI passes
0 commit comments