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
{{ message }}
Repository navigation
Commit 4281530
Browse filesBrowse the repository at this point in the historyBrowse files
fix: Warn when a requested timeout is capped at timeout_max (#962)
An explicit per-call `timeout` timedelta larger than `timeout_max`
(default 360 s), or a tier configured above it, is clamped to
`timeout_max` on every attempt. For example,
`dataset.get_items_as_bytes(timeout=timedelta(minutes=30))` runs every
attempt with a 360 s timeout and surfaces as repeated
`impit.TimeoutException`, with no hint that the requested 30 minutes
never took effect.
The behavior stays unchanged: `timeout_max` remains a hard ceiling for
any single request attempt. Only visibility changes. `_compute_timeout`
now logs a warning when the resolved base timeout exceeds `timeout_max`,
naming both values and pointing at `timeout_max` as the knob to raise.
The warning goes through `LoggerOnce`, a small dedup helper ported from
Crawlee for Python, so a recurring cut-off is reported once per timeout
kind rather than on every attempt of every call.
Docs and docstrings now state that the cap applies to tier and per-call
timeouts alike.
*✍️ Drafted by Claude Code*
Copy file name to clipboardExpand all lines: docs/02_concepts/11_timeouts.mdx
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Every client method has a pre-assigned tier that matches the expected duration o
25
25
26
26
## Configuring default timeouts
27
27
28
-
You can override the default values for each tier in the <ApiLinkto="class/ApifyClient">`ApifyClient`</ApiLink> or <ApiLinkto="class/ApifyClientAsync">`ApifyClientAsync`</ApiLink> constructor. The `timeout_max` parameter sets an upper cap on the timeout for any individual API request, limiting exponential growth during retries.
28
+
You can override the default values for each tier in the <ApiLinkto="class/ApifyClient">`ApifyClient`</ApiLink> or <ApiLinkto="class/ApifyClientAsync">`ApifyClientAsync`</ApiLink> constructor. The `timeout_max` parameter sets an upper cap on the timeout for any individual API request, limiting exponential growth during retries. It caps tier and per-call timeouts as well, so raise it whenever you need a timeout longer than the default 360 seconds. A tier configured above the cap is capped too, and the client logs a warning to make the cut-off visible.
A `timedelta` longer than `timeout_max` is capped at `timeout_max`, and the client logs a warning. To let such a call use its full timeout, raise `timeout_max` in the client constructor.
61
+
60
62
## Interaction with retries
61
63
62
64
Timeouts work together with the [retry system](/api/client/python/docs/concepts/retries). When a request times out, it counts as a failed attempt and triggers a retry (up to `max_retries`). The timeout applies to each individual attempt, not the total time across all retries.
0 commit comments