Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(data-warehouse): bound and interrupt source retry waits (#113475)

Tom Owers1962c9e361d9
diff --git a/.agents/skills/implementing-warehouse-sources/SKILL.md b/.agents/skills/implementing-warehouse-sources/SKILL.md
index 2b93c7302762..662884fb200d 100644
--- a/.agents/skills/implementing-warehouse-sources/SKILL.md
+++ b/.agents/skills/implementing-warehouse-sources/SKILL.md
@@ -646,6 +646,9 @@ If undocumented, keep parsing/merge logic conservative and add a short code comm
## Retry and throttling strategy
- **`make_tracked_session()` and `rest_source.RESTClient` already retry `429` + transient `5xx` at the transport layer**, honoring `Retry-After`. Do NOT wrap a second `tenacity` `@retry` around your fetch for status codes — it compounds (e.g. 3 transport attempts × 5 tenacity attempts) and is the single most-copied mistake across existing sources. If you use the framework or the tracked session, status-code retries are already handled; write none.
+- **One layer owns the retries of a request.** `RESTClient` retries its own requests (5 attempts by default) and turns the adapter retries off for them. A bespoke call on a tracked session keeps the adapter retries (3 retries, `GET`/`HEAD`/`OPTIONS` only).
+- **Retry waits are bounded.** One request spends at most `DATA_WAREHOUSE_SOURCE_RETRY_BUDGET_SECONDS` (600 s) on retries. `RESTClient` fails a request with a retryable error when the server asks for a wait above `DATA_WAREHOUSE_SOURCE_MAX_RETRY_AFTER_SECONDS` (300 s). For a vendor with a longer rate limit window, set `retry_after_max_seconds` and `retry_budget_seconds` in the client config.
+- **Do not call `time.sleep` for a backoff or a rate limit hold.** Call `interruptible_wait()` from `common/interruptible_wait.py`. It ends the wait when the worker starts to shut down and the run can resume. Pass `safe_point=` only from a position where the staged cursor covers no row that the source still holds.
- Only add `tenacity` for a condition the transport does **not** cover — e.g. an app-level "still processing" body that isn't a retryable HTTP status. If you do, disable transport retries so they don't compound: `make_tracked_session(retry=Retry(total=0))`.
- Prefer server-provided rate-limit reset headers on `429` — the transport already honors `Retry-After`. Keep any custom retry bounded and deterministic (`stop_after_attempt`), with clear terminal behavior.
- Keep timeout/retry settings near the top of the module for easy tuning.
diff --git a/posthog/settings/data_warehouse.py b/posthog/settings/data_warehouse.py
index d6bedf19fecb..54df85da6086 100644
--- a/posthog/settings/data_warehouse.py
+++ b/posthog/settings/data_warehouse.py
@@ -53,6 +53,19 @@ DATA_WAREHOUSE_SOURCE_READ_TIMEOUT_SECONDS = get_from_env(
"DATA_WAREHOUSE_SOURCE_READ_TIMEOUT_SECONDS", 300.0, type_cast=float
)
+# Longest time in seconds that one source request may spend on retries, from its first failure. No
+# new try starts after it. A client can pass its own value when a vendor's rate limit window is longer.
+DATA_WAREHOUSE_SOURCE_RETRY_BUDGET_SECONDS = get_from_env(
+ "DATA_WAREHOUSE_SOURCE_RETRY_BUDGET_SECONDS", 600.0, type_cast=float
+)
+
+# Longest server-provided retry delay (`Retry-After` or a rate limit reset header) in seconds that
+# the shared REST client and the request pacer wait for. The REST client fails the request with a
+# retryable error when the server asks for more, and the pacer holds for this long at most.
+DATA_WAREHOUSE_SOURCE_MAX_RETRY_AFTER_SECONDS = get_from_env(
+ "DATA_WAREHOUSE_SOURCE_MAX_RETRY_AFTER_SECONDS", 300.0, type_cast=float
+)
+
# Region hosting BUCKET_URL. Only used to build the bucket's virtual-hosted hostname for the
# egress-proxy bypass in products/data_warehouse/backend/s3_proxy.py; the AWS clients resolve their
# own region as before. Falls back to the ambient AWS_REGION, and an empty value leaves the bypass
diff --git a/products/warehouse_sources/backend/temporal/data_imports/pipelines/pipeline_v3/pipeline.py b/products/warehouse_sources/backend/temporal/data_imports/pipelines/pipeline_v3/pipeline.py
index ea3613be38ea..cd7582f4977c 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/pipelines/pipeline_v3/pipeline.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/pipelines/pipeline_v3/pipeline.py
@@ -493,7 +493,11 @@ class PipelineV3(Generic[ResumableData]):
),
)
scope.enter_context(
- activate_safe_point(handler, covers_framework_checkpoints=source_items_are_framework_output(items))
+ activate_safe_point(
+ handler,
+ covers_framework_checkpoints=source_items_are_framework_output(items),
+ is_shutting_down=self._shutdown_monitor.is_worker_shutdown,
+ )
)
return scope
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/anthropic/anthropic.py b/products/warehouse_sources/backend/temporal/data_imports/sources/anthropic/anthropic.py
index 4cd3fafebbd0..d249afaef6bd 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/anthropic/anthropic.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/anthropic/anthropic.py
@@ -55,6 +55,9 @@ MAX_RETRY_ATTEMPTS = 8
# sync never stalls indefinitely.
REPORT_MAX_RETRY_ATTEMPTS = 12
REPORT_RETRY_BACKOFF_MAX_SECONDS = 300.0
+# The waits of the report attempts above add up to about 1,100 seconds, which is more than the
+# shared client's default budget for one request.
+REPORT_RETRY_BUDGET_SECONDS = 1200.0
# Floor for the required `starting_at` on a full refresh. Anthropic launched in 2023, so no usage or
# cost data can predate this — starting here rather than the epoch avoids requesting decades of empty
# buckets while still pulling all available history.
@@ -829,6 +832,7 @@ def anthropic_source(
}
if is_report_endpoint:
client_config["retry_backoff_max_seconds"] = REPORT_RETRY_BACKOFF_MAX_SECONDS
+ client_config["retry_budget_seconds"] = REPORT_RETRY_BUDGET_SECONDS
resume = resumable_source_manager.load_state() if resumable_source_manager.can_resume() else None
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/http/__init__.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/http/__init__.py
index 5a618a751143..5755af2415f0 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/http/__init__.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/http/__init__.py
@@ -13,6 +13,7 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.htt
make_tracked_adapter,
make_tracked_session,
resolve_request_timeout,
+ suspend_adapter_retries,
)
__all__ = [
@@ -28,4 +29,5 @@ __all__ = [
"make_tracked_session",
"resolve_request_timeout",
"scoped_job_context",
+ "suspend_adapter_retries",
]
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/http/tests/test_transport.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/http/tests/test_transport.py
index c95573fdf28e..b2c9b39015b1 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/http/tests/test_transport.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/http/tests/test_transport.py
@@ -1,11 +1,17 @@
-from unittest.mock import MagicMock
+import pytest
+from unittest.mock import MagicMock, patch
+
+from django.test import override_settings
from parameterized import parameterized
+from urllib3.exceptions import MaxRetryError, ReadTimeoutError
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.http import transport
from products.warehouse_sources.backend.temporal.data_imports.sources.common.http.transport import (
DEFAULT_RETRY,
BoundedRetry,
)
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.safe_point import activate_safe_point
def _response_with_retry_after(value: str) -> MagicMock:
@@ -66,3 +72,36 @@ class TestBoundedRetry:
def test_default_retry_skips_non_idempotent_methods(self) -> None:
# A POST is not safe to replay, so even a transient timeout must not be retried.
assert DEFAULT_RETRY.is_retry("POST", 524) is False
+
+ @parameterized.expand(
+ [
+ ("status", {"response": MagicMock(status=503, **{"get_redirect_location.return_value": False})}),
+ ("read_error", {"error": ReadTimeoutError(MagicMock(), "/items", "read timed out")}),
+ ]
+ )
+ @override_settings(DATA_WAREHOUSE_SOURCE_RETRY_BUDGET_SECONDS=600.0)
+ def test_retries_of_one_request_stop_at_the_budget(self, _name: str, failure: dict) -> None:
+ now = 0.0
+ retry = BoundedRetry(total=10, status_forcelist=(503,), raise_on_status=False)
+ with patch.object(transport, "_monotonic", lambda: now):
+ retry = retry.increment("GET", "/items", **failure)
+ now = 599.0
+ retry = retry.increment("GET", "/items", **failure)
+ now = 600.0
+ with pytest.raises(MaxRetryError):
+ retry.increment("GET", "/items", **failure)
+
+ @parameterized.expand([("worker_running", False, 60.0), ("worker_shutting_down", True, 0.0)])
+ def test_a_retry_wait_ends_when_the_worker_shuts_down(
+ self, _name: str, shutting_down: bool, expected_sleep: float
+ ) -> None:
+ safe_point = MagicMock()
+ with (
+ patch("time.sleep") as sleep,
+ activate_safe_point(safe_point, covers_framework_checkpoints=True, is_shutting_down=lambda: shutting_down),
+ ):
+ BoundedRetry(total=3).sleep(_response_with_retry_after("60"))
+
+ assert sum(call.args[0] for call in sleep.call_args_list) == expected_sleep
+ # The adapter cannot know where the source is, so it never reaches a safe point by itself.
+ safe_point.assert_not_called()
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/http/transport.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/http/transport.py
index a3ba1d60e9e8..49e27e5ae043 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/http/transport.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/http/transport.py
@@ -16,7 +16,9 @@ from __future__ import annotations
import math
import time
-from collections.abc import Mapping
+from collections.abc import Iterator, Mapping
+from contextlib import contextmanager
+from contextvars import ContextVar
from typing import Any, cast
from django.conf import settings
@@ -24,10 +26,14 @@ from django.conf import settings
import requests
from requests import PreparedRequest, Response
from requests.adapters import HTTPAdapter
-from urllib3.exceptions import InvalidHeader
+from urllib3.exceptions import InvalidHeader, MaxRetryError, ResponseError
from urllib3.util.retry import Retry
from products.warehouse_sources.backend.temporal.data_imports.sources.common.http.observer import record_request
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.interruptible_wait import (
+ interruptible_wait,
+)
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.retry_limits import retry_budget_seconds
RequestTimeout = float | tuple[float, float] | tuple[float, None]
@@ -49,6 +55,28 @@ def resolve_request_timeout(timeout: RequestTimeout | None) -> RequestTimeout:
return default_request_timeout() if timeout is None else timeout
+_monotonic = time.monotonic
+
+# The same policy as the `requests` default: no retry, and a read error keeps its own type.
+NO_RETRY = Retry(0, read=False)
+
+_adapter_retries_suspended: ContextVar[bool] = ContextVar("warehouse_source_adapter_retries_suspended", default=False)
+
+
+@contextmanager
+def suspend_adapter_retries() -> Iterator[None]:
+ """Send requests in the block with no adapter-level retry.
+
+ For a caller that owns the retries of its requests. Two retry layers multiply their tries and
+ their waits, and only the outer one can reach a safe point before a wait.
+ """
+ token = _adapter_retries_suspended.set(True)
+ try:
+ yield
+ finally:
+ _adapter_retries_suspended.reset(token)
+
+
class BoundedRetry(Retry):
"""`Retry` that hardens `Retry-After` handling against hostile or sloppy servers.
@@ -64,8 +92,57 @@ class BoundedRetry(Retry):
else. Some upstream APIs send fractional seconds (e.g. "0.129") instead, which
otherwise turns a should-be-transient rate limit into a hard failure.
`parse_retry_after` tolerates fractional values and falls back to no delay.
+
+ Two more limits keep one request from holding a worker:
+
+ - All retries of one request share `retry_budget_seconds()`, counted from the first failure.
+ When it is spent, the last response or error goes to the caller.
+ - A wait ends early when the worker starts to shut down, so the caller can hand the run off.
"""
+ def __init__(self, *args: Any, retry_deadline: float | None = None, **kwargs: Any) -> None:
+ super().__init__(*args, **kwargs)
+ self._retry_deadline = retry_deadline
+
+ def new(self, **kw: Any) -> BoundedRetry:
+ # urllib3 builds a new object for each try, so the deadline must travel with it.
+ kw.setdefault("retry_deadline", self._retry_deadline)
+ return cast(BoundedRetry, super().new(**kw))
+
+ def increment(
+ self,
+ method: str | None = None,
+ url: str | None = None,
+ response: Any = None,
+ error: Exception | None = None,
+ _pool: Any = None,
+ _stacktrace: Any = None,
+ ) -> BoundedRetry:
+ retry = cast(
+ BoundedRetry,
+ super().increment(
+ method=method, url=url, response=response, error=error, _pool=_pool, _stacktrace=_stacktrace
+ ),
+ )
+ now = _monotonic()
+ deadline = now + retry_budget_seconds() if self._retry_deadline is None else self._retry_deadline
+ if now >= deadline:
+ raise MaxRetryError(_pool, url or "", error or ResponseError("retry budget spent"))
+ retry._retry_deadline = deadline
+ return retry
+
+ def sleep_for_retry(self, response: Any = None) -> bool:
+ retry_after = self.get_retry_after(response)
+ if retry_after:
+ interruptible_wait(retry_after)
+ return True
+ return False
+
+ def _sleep_backoff(self) -> None:
+ backoff = self.get_backoff_time()
+ if backoff > 0:
+ interruptible_wait(backoff)
+
def parse_retry_after(self, retry_after: str) -> float:
try:
return super().parse_retry_after(retry_after)
@@ -130,6 +207,14 @@ class TrackedHTTPAdapter(HTTPAdapter):
self._capture = capture
super().__init__(*args, **kwargs)
+ @property
+ def max_retries(self) -> Retry:
+ return NO_RETRY if _adapter_retries_suspended.get() else self._max_retries
+
+ @max_retries.setter
+ def max_retries(self, value: Retry) -> None:
+ self._max_retries = value
+
def send(
self,
request: PreparedRequest,
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/interruptible_wait.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/interruptible_wait.py
new file mode 100644
index 000000000000..e9b0efabf97b
--- /dev/null
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/interruptible_wait.py
@@ -0,0 +1,41 @@
+"""A wait that ends when the worker starts to shut down.
+
+A source that sleeps through a backoff or a rate limit hold yields nothing in that time, so the
+pipeline cannot hand the run to another worker until the sleep ends. `interruptible_wait` polls the
+shutdown signal that the pipeline installs with the safe point. Outside such a run it is a plain
+sleep, because a run that cannot resume loses its progress when it stops early.
+"""
+
+import time
+from collections.abc import Callable
+
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.safe_point import shutdown_signal
+
+# The longest time a wait continues after the worker starts to shut down.
+WAIT_SLICE_SECONDS = 1.0
+
+
+def interruptible_wait(seconds: float, *, safe_point: Callable[[], None] | None = None) -> bool:
+ """Wait `seconds`, or less when the worker starts to shut down. Return True when the wait ended early.
+
+ Pass `safe_point` only from a position where the run can stop and resume without losing rows.
+ It runs when the worker is shutting down, and the pipeline's hook then raises
+ `WorkerShuttingDownError`. A caller that cannot know the position of the source (the HTTP
+ adapter, a request pacer on a pool thread) passes none and gets the early return only.
+ """
+ is_shutting_down = shutdown_signal()
+ if is_shutting_down is None:
+ time.sleep(seconds)
+ return False
+
+ remaining = seconds
+ while True:
+ if is_shutting_down():
+ if safe_point is not None:
+ safe_point()
+ return True
+ if remaining <= 0:
+ return False
+ step = min(remaining, WAIT_SLICE_SECONDS)
+ time.sleep(step)
+ remaining -= step
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/request_pacer.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/request_pacer.py
index 6b19ffe10e6a..48e6460172e5 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/request_pacer.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/request_pacer.py
@@ -5,6 +5,11 @@ from collections.abc import Callable
from concurrent.futures import Future, ThreadPoolExecutor
from typing import Optional, ParamSpec, TypeVar
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.interruptible_wait import (
+ interruptible_wait,
+)
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.retry_limits import max_retry_after_seconds
+
_P = ParamSpec("_P")
_T = TypeVar("_T")
@@ -36,6 +41,10 @@ class RequestPacer:
waiting for a slot. Each quiet window after that doubles the rate back until the base rate
is restored.
+ A hold is never longer than `max_retry_after_seconds()`, whatever the vendor sends. A wait ends
+ early when the worker starts to shut down: the request then goes out at once, so its thread
+ returns and the source can hand the run off. `sleep` returns True to report that.
+
The budget being protected belongs to the customer's own account on the vendor, so this is a
caller-side courtesy rather than a shared PostHog budget. An API whose credential PostHog owns
belongs in `posthog/egress/` instead.
@@ -45,7 +54,7 @@ class RequestPacer:
self,
per_second: float,
clock: Callable[[], float] = time.monotonic,
- sleep: Callable[[float], None] = time.sleep,
+ sleep: Callable[[float], bool | None] = interruptible_wait,
hold_seconds: float = RATE_LIMIT_HOLD_SECONDS,
) -> None:
self._base_interval = 1.0 / per_second
@@ -62,8 +71,8 @@ class RequestPacer:
start = self._reserve_slot()
while True:
delay = start - self._clock()
- if delay > 0:
- self._sleep(delay)
+ if delay > 0 and self._sleep(delay):
+ return
with self._lock:
if self._hold_until <= start:
return
@@ -81,6 +90,8 @@ class RequestPacer:
return start
def throttled(self, retry_after: Optional[float]) -> None:
+ if retry_after is not None:
+ retry_after = min(retry_after, max_retry_after_seconds())
with self._lock:
now = self._clock()
if now < self._hold_until:
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/__init__.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/__init__.py
index b9d061299b22..0491b6ebd074 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/__init__.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/__init__.py
@@ -284,6 +284,15 @@ def _make_paginate_dependent_resource(
return paginate_dependent_resource
+def _retry_limit_overrides(client_config: ClientConfig) -> dict[str, float]:
+ # Passed only when a source sets them, so a client built with neither keeps the settings.
+ return {
+ key: client_config[key] # type: ignore[literal-required]
+ for key in ("retry_budget_seconds", "retry_after_max_seconds")
+ if key in client_config
+ }
+
+
def create_resources(
client_config: ClientConfig,
dependency_graph: graphlib.TopologicalSorter,
@@ -343,6 +352,7 @@ def create_resources(
allow_redirects=client_config.get("allow_redirects", True),
request_timeout=client_config.get("request_timeout"),
capture=client_config.get("capture", True),
+ **_retry_limit_overrides(client_config),
)
hooks = create_response_hooks(endpoint_config.get("response_actions"), resource_name=resource_name)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/rest_client.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/rest_client.py
index 47529fe9989a..090be7afdd4b 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/rest_client.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/rest_client.py
@@ -1,5 +1,6 @@
import re
import copy
+import time
import logging
from collections.abc import Callable, Iterator
from datetime import UTC, datetime
@@ -7,7 +8,7 @@ from email.utils import parsedate_to_datetime
from typing import Any, Optional
from urllib.parse import urlsplit
-from requests import Request, Response, Session
+from requests import PreparedRequest, Request, Response, Session
from requests.auth import AuthBase
from requests.exceptions import (
ChunkedEncodingError,
@@ -24,6 +25,14 @@ from posthog.temporal.common.errors import NonReportableError
from products.warehouse_sources.backend.temporal.data_imports.sources.common.http import (
RequestTimeout,
make_tracked_session,
+ suspend_adapter_retries,
+)
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.interruptible_wait import (
+ interruptible_wait,
+)
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.retry_limits import (
+ max_retry_after_seconds,
+ retry_budget_seconds,
)
from products.warehouse_sources.backend.temporal.data_imports.sources.common.safe_point import (
reach_framework_safe_point,
@@ -166,9 +175,7 @@ def _safe_url(url: str) -> str:
return f"{parts.scheme}://{host}{parts.path}"
-# Upper bound on how long we'll honor a server-provided retry delay, so a
-# misreported header can't stall a worker for an unbounded amount of time.
-MAX_RETRY_AFTER_SECONDS = 300.0
+_monotonic = time.monotonic
# Attempts for the default sync path. The inline preview overrides this to 1 so a
# rate-limited endpoint surfaces an error instead of sleeping on `Retry-After`.
@@ -238,18 +245,19 @@ def _parse_retry_after(response: Response) -> Optional[float]:
Honors the standard ``Retry-After`` header (delta-seconds or HTTP-date) first, then the
vendor rate-limit reset headers in ``_RATE_LIMIT_RESET_HEADERS``. Without a server-provided
delay a 429 backs off on the short exponential fallback and the attempt budget is spent long
- before the limit window clears. Capped at ``MAX_RETRY_AFTER_SECONDS``.
+ before the limit window clears. The value is not capped here: the retry loop fails the request
+ when the server asks for more than the client's limit.
"""
retry_after_header = response.headers.get("Retry-After")
if retry_after_header:
try:
- return min(float(retry_after_header), MAX_RETRY_AFTER_SECONDS)
+ return max(0.0, float(retry_after_header))
except ValueError:
try:
dt = parsedate_to_datetime(retry_after_header)
except (TypeError, ValueError):
return None
- return min(max(0.0, (dt - datetime.now(UTC)).total_seconds()), MAX_RETRY_AFTER_SECONDS)
+ return max(0.0, (dt - datetime.now(UTC)).total_seconds())
for header, parse in _RATE_LIMIT_RESET_HEADERS:
value = response.headers.get(header)
@@ -260,11 +268,23 @@ def _parse_retry_after(response: Response) -> Optional[float]:
# through to the caller's exponential backoff rather than retrying with no delay at all.
if wait_seconds is None or wait_seconds <= 0:
return None
- return min(wait_seconds, MAX_RETRY_AFTER_SECONDS)
+ return wait_seconds
return None
+def _retry_after_exceeds_limit(client: Any, exc: Optional[BaseException]) -> bool:
+ if not isinstance(exc, RESTClientRetryableError) or exc.retry_after is None:
+ return False
+ limit = getattr(client, "_retry_after_max", None)
+ return exc.retry_after > (max_retry_after_seconds() if limit is None else limit)
+
+
+def _start_retry_budget(state: RetryCallState) -> None:
+ if state.attempt_number == 1:
+ state.retry_object.statistics["budget_started_at"] = _monotonic()
+
+
def _stop_after_client_attempts(state: RetryCallState) -> bool:
# tenacity passes the wrapped call's positional args; for the bound
# `_send_request(self, ...)` that's `(client, request, hooks)`, so the
@@ -274,9 +294,24 @@ def _stop_after_client_attempts(state: RetryCallState) -> bool:
return state.attempt_number >= max_attempts
+def _stop_retrying(state: RetryCallState) -> bool:
+ if _stop_after_client_attempts(state):
+ return True
+ client = state.args[0] if state.args else None
+ # A server that asks for a longer wait than the limit is not going to answer soon. The error
+ # goes to the activity, whose own retry comes back later, and the worker stays free.
+ exc = state.outcome.exception() if state.outcome is not None and state.outcome.failed else None
+ if _retry_after_exceeds_limit(client, exc):
+ return True
+ # No try starts after the budget, and no wait starts that would end after it.
+ budget = getattr(client, "_retry_budget", None)
+ elapsed = _monotonic() - state.retry_object.statistics.get("budget_started_at", _monotonic())
+ return elapsed + state.upcoming_sleep > (retry_budget_seconds() if budget is None else budget)
+
+
def _retry_wait_seconds(state: RetryCallState) -> float:
- # Read the backoff ceiling off the bound instance the same way `_stop_after_client_attempts`
- # reads the attempt cap, so a client with a longer rate-limit window can widen its own backoff.
+ # Read the backoff ceiling off the bound instance the same way `_stop_retrying` reads its
+ # limits, so a client with a longer rate-limit window can widen its own backoff.
client = state.args[0] if state.args else None
ceiling = getattr(client, "_retry_backoff_max", DEFAULT_RETRY_BACKOFF_MAX_SECONDS)
fallback = min(2 ** (state.attempt_number - 1), ceiling)
@@ -284,7 +319,7 @@ def _retry_wait_seconds(state: RetryCallState) -> float:
return float(fallback)
exc = state.outcome.exception()
if isinstance(exc, RESTClientRetryableError) and exc.retry_after is not None:
- return min(exc.retry_after, MAX_RETRY_AFTER_SECONDS)
+ return exc.retry_after
return float(fallback)
@@ -294,6 +329,12 @@ def _reach_safe_point_before_retry_wait(_state: RetryCallState) -> None:
reach_framework_safe_point()
+def _wait_before_retry(seconds: float) -> None:
+ # The same position as `_reach_safe_point_before_retry_wait`, so a shutdown that starts during
+ # the wait ends the run at the safe point and does not wait for the rest of the delay.
+ interruptible_wait(seconds, safe_point=reach_framework_safe_point)
+
+
Hooks = dict[str, list[Any]]
@@ -328,6 +369,8 @@ class RESTClient:
allow_redirects: bool = True,
request_timeout: Optional[RequestTimeout] = None,
capture: bool = True,
+ retry_budget_seconds: Optional[float] = None,
+ retry_after_max_seconds: Optional[float] = None,
) -> None:
self.base_url = base_url or ""
self.headers = headers or {}
@@ -335,6 +378,11 @@ class RESTClient:
self.paginator = paginator
self._max_retry_attempts = max_retry_attempts
self._retry_backoff_max = retry_backoff_max_seconds
+ # Longest time one request may spend on retries, and longest server-provided delay the
+ # client waits for. Left None, the settings apply. A source whose vendor has a longer rate
+ # limit window raises both, so the client waits the window out and does not fail the run.
+ self._retry_budget = retry_budget_seconds
+ self._retry_after_max = retry_after_max_seconds
# Per-request (connect, read) timeout in seconds handed to ``session.send``. Left None,
# the session's own default applies, and after that the tracked adapter's
# ``default_request_timeout()``. Sources talking to a customer-controlled host should set
@@ -518,11 +566,22 @@ class RESTClient:
if paginator is None or not paginator.has_next_page:
break
+ def _send(self, prepared: PreparedRequest) -> Response:
+ if self._max_retry_attempts <= 1:
+ # This client does not retry, so the adapter keeps its own retries.
+ return self.session.send(prepared, allow_redirects=self._allow_redirects, timeout=self._request_timeout)
+ # This client owns the retries. With the adapter's retries on too, the tries and the waits
+ # of the two layers multiply, and the adapter's waits have no safe point.
+ with suspend_adapter_retries():
+ return self.session.send(prepared, allow_redirects=self._allow_redirects, timeout=self._request_timeout)
+
@retry(
retry=retry_if_exception_type(RESTClientRetryableError),
- stop=_stop_after_client_attempts,
+ stop=_stop_retrying,
wait=_retry_wait_seconds,
+ before=_start_retry_budget,
before_sleep=_reach_safe_point_before_retry_wait,
+ sleep=_wait_before_retry,
reraise=True,
)
def _send_request(
@@ -536,12 +595,11 @@ class RESTClient:
# `send` reads the body eagerly (stream=False), so a connection dropped mid-stream
# surfaces here as ChunkedEncodingError. A connection that never got established at all —
# egress proxy refusing/resetting the connection, a connect timeout — surfaces as
- # ConnectionError (already retried a few times inside urllib3's own adapter-level policy,
- # but that budget is short). Both are transient network failures, so reissue them like a
+ # ConnectionError. Both are transient network failures, so reissue them like a
# truncated/partial body below rather than letting them skip this retry loop and fail the
# whole sync on one bad connection attempt.
try:
- response = self.session.send(prepared, allow_redirects=self._allow_redirects, timeout=self._request_timeout)
+ response = self._send(prepared)
except ChunkedEncodingError as e:
raise RESTClientRetryableError(self._redact(f"Connection broken while reading response: {e}")) from e
except RequestsConnectionError as e:
@@ -588,10 +646,15 @@ class RESTClient:
# `_safe_url` drops the query string entirely: `_redact` only masks the raw secret, not
# the percent-encoded form an `api_key` query credential takes in the URL, so scheme/
# host/path-only is what keeps an encoded credential out of the persisted `latest_error`.
- raise RESTClientRetryableError(
- self._redact(f"HTTP {response.status_code} for {_safe_url(response.url)}"),
- retry_after=_parse_retry_after(response),
- )
+ retry_after = _parse_retry_after(response)
+ message = f"HTTP {response.status_code} for {_safe_url(response.url)}"
+ error = RESTClientRetryableError(self._redact(message), retry_after=retry_after)
+ if _retry_after_exceeds_limit(self, error):
+ error = RESTClientRetryableError(
+ self._redact(f"{message} (the server asked for a wait of {retry_after:.0f} seconds)"),
+ retry_after=retry_after,
+ )
+ raise error
response_hooks = hooks.get("response", [])
if response_hooks:
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/tests/test_rest_client.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/tests/test_rest_client.py
index a1419c5c79d3..d88d3dc4755c 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/tests/test_rest_client.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/tests/test_rest_client.py
@@ -20,7 +20,6 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.res
SinglePagePaginator,
)
from products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source.rest_client import (
- MAX_RETRY_AFTER_SECONDS,
RESTClient,
RESTClientNonRetryableError,
RESTClientRetryableError,
@@ -817,7 +816,7 @@ class TestRESTClient:
[
("rfc3339_utc", "2026-03-06T12:00:45Z", 45.0),
("rfc3339_offset", "2026-03-06T12:01:00+00:00", 60.0),
- ("capped", "2027-03-06T12:00:00Z", MAX_RETRY_AFTER_SECONDS),
+ ("far_future", "2026-03-06T13:00:00Z", 3600.0),
# A window that has already cleared, or a value we can't read, tells us nothing — the
# caller falls back to exponential backoff rather than retrying with no delay at all.
("already_elapsed", "2026-03-06T11:59:55Z", None),
@@ -851,17 +850,6 @@ class TestRESTClient:
assert _parse_retry_after(response) == 120
- @patch("products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source.rest_client.datetime")
- def test_parse_retry_after_caps_sentry_reset_header(self, mock_datetime) -> None:
- # A reset far in the future must be clamped to MAX_RETRY_AFTER_SECONDS.
- now = datetime(2026, 3, 6, 12, 0, 0, tzinfo=UTC)
- mock_datetime.now.return_value = now
-
- response = _make_response({"error": "rate limited"}, status_code=429)
- response.headers["X-Sentry-Rate-Limit-Reset"] = str(int(now.timestamp()) + 10_000)
-
- assert _parse_retry_after(response) == MAX_RETRY_AFTER_SECONDS
-
@patch("products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source.rest_client.datetime")
def test_parse_retry_after_ignores_already_elapsed_sentry_reset(self, mock_datetime) -> None:
now = datetime(2026, 3, 6, 12, 0, 0, tzinfo=UTC)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/tests/test_retry_budget.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/tests/test_retry_budget.py
new file mode 100644
index 000000000000..dec18c76400b
--- /dev/null
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/tests/test_retry_budget.py
@@ -0,0 +1,270 @@
+from collections.abc import Iterator
+from contextlib import contextmanager
+from datetime import UTC, datetime
+from typing import Any
+
+import pytest
+from unittest.mock import MagicMock, patch
+
+from django.test import override_settings
+
+import requests
+from parameterized import parameterized
+from requests.adapters import HTTPAdapter
+
+from posthog.dataclasses import frozen
+from posthog.temporal.common.shutdown import WorkerShuttingDownError
+
+from products.warehouse_sources.backend.temporal.data_imports.pipelines.common.safe_point import (
+ PipelineSafePointHandler,
+)
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.http import make_tracked_session
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.interruptible_wait import (
+ WAIT_SLICE_SECONDS,
+)
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source import rest_client
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source.paginators import (
+ SinglePagePaginator,
+)
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source.rest_client import (
+ RESTClient,
+ RESTClientRetryableError,
+)
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.safe_point import activate_safe_point
+
+BASE_URL = "https://api.example.com"
+BUDGET = 600.0
+MAX_RETRY_AFTER = 300.0
+
+
+class _Clock:
+ def __init__(self) -> None:
+ self.now = 0.0
+ self.sleeps: list[float] = []
+
+ def monotonic(self) -> float:
+ return self.now
+
+ def sleep(self, seconds: float) -> None:
+ self.sleeps.append(seconds)
+ self.now += seconds
+
+
+@contextmanager
+def _fake_time() -> Iterator[_Clock]:
+ clock = _Clock()
+ with (
+ override_settings(
+ DATA_WAREHOUSE_SOURCE_RETRY_BUDGET_SECONDS=BUDGET,
+ DATA_WAREHOUSE_SOURCE_MAX_RETRY_AFTER_SECONDS=MAX_RETRY_AFTER,
+ ),
+ patch("time.sleep", side_effect=clock.sleep),
+ patch.object(rest_client, "_monotonic", clock.monotonic),
+ ):
+ yield clock
+
+
+def _response(status: int, headers: dict[str, str] | None = None) -> requests.Response:
+ response = requests.Response()
+ response.status_code = status
+ response.url = f"{BASE_URL}/items"
+ response._content = b"[]"
+ response.headers.update(headers or {})
+ return response
+
+
+class _Host:
+ """A session whose every answer is the same failure and takes `attempt_seconds` to arrive."""
+
+ def __init__(self, clock: _Clock, status: int, headers: dict[str, str] | None, attempt_seconds: float) -> None:
+ self.headers: dict[str, str] = {}
+ self.starts: list[float] = []
+ self._clock = clock
+ self._status = status
+ self._headers = headers
+ self._attempt_seconds = attempt_seconds
+
+ def prepare_request(self, _request: requests.Request) -> MagicMock:
+ return MagicMock(url=f"{BASE_URL}/items")
+
+ def send(self, _request: Any, **_kwargs: Any) -> requests.Response:
+ self.starts.append(self._clock.now)
+ self._clock.now += self._attempt_seconds
+ return _response(self._status, self._headers)
+
+
+def _paginate(client: RESTClient) -> None:
+ list(client.paginate(path="/items", paginator=SinglePagePaginator()))
+
+
+class _ShutdownMonitor:
+ def __init__(self) -> None:
+ self.shutting_down = False
+
+ def is_worker_shutdown(self) -> bool:
+ return self.shutting_down
+
+ def raise_if_is_worker_shutdown(self) -> None:
+ if self.shutting_down:
+ raise WorkerShuttingDownError("activity", "import", "queue", 1, None, None)
+
+
+class TestRetryBudget:
+ @parameterized.expand(
+ [
+ ("server_error_fails_fast", 503, None, 0.0),
+ ("server_error_after_a_stalled_read", 503, None, 330.0),
+ ("rate_limit_without_a_delay", 429, None, 0.0),
+ ("rate_limit_with_a_delay", 429, {"Retry-After": "200"}, 0.0),
+ ("rate_limit_with_the_longest_allowed_delay", 429, {"Retry-After": "300"}, 5.0),
+ ]
+ )
+ def test_one_request_starts_no_try_after_its_budget(
+ self, _name: str, status: int, headers: dict[str, str] | None, attempt_seconds: float
+ ) -> None:
+ with _fake_time() as clock:
+ host = _Host(clock, status, headers, attempt_seconds)
+ # More attempts than the budget allows, so the budget is the limit under test.
+ client = RESTClient(base_url=BASE_URL, session=host, max_retry_attempts=100) # type: ignore[arg-type]
+ with pytest.raises(RESTClientRetryableError):
+ _paginate(client)
+
+ assert len(host.starts) >= 2
+ assert host.starts[-1] <= BUDGET
+ assert clock.now <= BUDGET + attempt_seconds
+
+ def test_a_client_budget_replaces_the_setting(self) -> None:
+ with _fake_time() as clock:
+ host = _Host(clock, 429, {"Retry-After": "200"}, 0.0)
+ client = RESTClient(base_url=BASE_URL, session=host, max_retry_attempts=100, retry_budget_seconds=1000.0) # type: ignore[arg-type]
+ with pytest.raises(RESTClientRetryableError):
+ _paginate(client)
+
+ assert clock.sleeps == [200.0] * 5
+
+ @parameterized.expand(
+ [
+ ("retry_after_seconds", {"Retry-After": "301"}),
+ ("retry_after_absurd", {"Retry-After": "100000000000"}),
+ ("reset_header", {"X-RateLimit-Reset": str(int(datetime.now(UTC).timestamp()) + 10_000)}),
+ ]
+ )
+ def test_a_delay_above_the_limit_fails_the_request_without_a_wait(
+ self, _name: str, headers: dict[str, str]
+ ) -> None:
+ with _fake_time() as clock:
+ host = _Host(clock, 429, headers, 0.0)
+ with pytest.raises(RESTClientRetryableError, match="asked for a wait"):
+ _paginate(RESTClient(base_url=BASE_URL, session=host)) # type: ignore[arg-type]
+
+ assert len(host.starts) == 1
+ assert clock.sleeps == []
+
+ def test_a_client_limit_lets_a_long_window_be_waited_out(self) -> None:
+ with _fake_time() as clock:
+ host = _Host(clock, 429, {"Retry-After": "900"}, 0.0)
+ client = RESTClient(
+ base_url=BASE_URL,
+ session=host, # type: ignore[arg-type]
+ max_retry_attempts=2,
+ retry_after_max_seconds=960.0,
+ retry_budget_seconds=1000.0,
+ )
+ with pytest.raises(RESTClientRetryableError):
+ _paginate(client)
+
+ assert clock.sleeps == [900.0]
+
+
+class TestRetryOwnership:
+ @parameterized.expand(
+ [
+ ("client_retries", 5, [0] * 5),
+ ("client_does_not_retry", 1, [3]),
+ ]
+ )
+ def test_only_one_layer_retries_a_request(
+ self, _name: str, max_retry_attempts: int, expected_adapter_retries: list[int]
+ ) -> None:
+ adapter_retries: list[int | bool | None] = []
+
+ def send(adapter: HTTPAdapter, _request: requests.PreparedRequest, **_kwargs: Any) -> requests.Response:
+ adapter_retries.append(adapter.max_retries.total)
+ return _response(503)
+
+ with _fake_time(), patch.object(HTTPAdapter, "send", autospec=True, side_effect=send):
+ with pytest.raises(RESTClientRetryableError):
+ _paginate(RESTClient(base_url=BASE_URL, max_retry_attempts=max_retry_attempts))
+
+ assert adapter_retries == expected_adapter_retries
+
+ def test_a_bespoke_session_call_keeps_the_adapter_retries(self) -> None:
+ adapter_retries: list[int | bool | None] = []
+
+ def send(adapter: HTTPAdapter, _request: requests.PreparedRequest, **_kwargs: Any) -> requests.Response:
+ adapter_retries.append(adapter.max_retries.total)
+ return _response(200)
+
+ with patch.object(HTTPAdapter, "send", autospec=True, side_effect=send):
+ make_tracked_session().get(f"{BASE_URL}/items")
+
+ assert adapter_retries == [3]
+
+
+@frozen
+class _Outcome:
+ clock: _Clock
+ host: _Host
+ error: BaseException
+
+
+class TestShutdownDuringARetryWait:
+ def _run(self, *, covers_framework_checkpoints: bool, with_signal: bool) -> _Outcome:
+ monitor = _ShutdownMonitor()
+ manager = MagicMock()
+ manager.has_staged_state.return_value = False
+ handler = PipelineSafePointHandler(
+ shutdown_monitor=monitor, # type: ignore[arg-type]
+ resumable_source_manager=manager,
+ has_unwritten_rows=lambda: False,
+ )
+
+ with _fake_time() as clock:
+ host = _Host(clock, 429, {"Retry-After": "200"}, 0.0)
+
+ def sleep(seconds: float) -> None:
+ clock.sleep(seconds)
+ monitor.shutting_down = True
+
+ with (
+ patch("time.sleep", side_effect=sleep),
+ activate_safe_point(
+ handler,
+ covers_framework_checkpoints=covers_framework_checkpoints,
+ is_shutting_down=monitor.is_worker_shutdown if with_signal else None,
+ ),
+ pytest.raises(Exception) as raised,
+ ):
+ _paginate(RESTClient(base_url=BASE_URL, session=host)) # type: ignore[arg-type]
+ return _Outcome(clock=clock, host=host, error=raised.value)
+
+ def test_the_run_hands_off_at_the_safe_point(self) -> None:
+ outcome = self._run(covers_framework_checkpoints=True, with_signal=True)
+
+ assert isinstance(outcome.error, WorkerShuttingDownError)
+ assert outcome.clock.now == WAIT_SLICE_SECONDS
+ assert len(outcome.host.starts) == 1
+
+ def test_a_wrapped_resource_stops_waiting_but_does_not_reach_a_safe_point(self) -> None:
+ outcome = self._run(covers_framework_checkpoints=False, with_signal=True)
+
+ assert isinstance(outcome.error, RESTClientRetryableError)
+ assert outcome.clock.now == WAIT_SLICE_SECONDS
+ assert len(outcome.host.starts) == 5
+
+ def test_a_run_that_cannot_hand_off_waits_the_whole_delay(self) -> None:
+ outcome = self._run(covers_framework_checkpoints=False, with_signal=False)
+
+ assert isinstance(outcome.error, RESTClientRetryableError)
+ assert outcome.clock.sleeps == [200.0, 200.0, 200.0]
+ assert outcome.host.starts[-1] <= BUDGET
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/typing.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/typing.py
index 9abec9145768..aaae66df327e 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/typing.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/typing.py
@@ -216,6 +216,11 @@ class ClientConfig(TypedDict, total=False):
# server-provided delay. Left unset, RESTClient uses its default. Raise it for an endpoint whose
# rate-limit window is longer than the default ceiling, so the retry budget can outlast the window.
retry_backoff_max_seconds: float
+ # Longest time one request may spend on retries, and longest server-provided delay
+ # (`Retry-After` or a rate limit reset header) the client waits for. Left unset, the
+ # `DATA_WAREHOUSE_SOURCE_*` settings apply. Raise both for a vendor with a longer rate limit window.
+ retry_budget_seconds: float
+ retry_after_max_seconds: float
# SSRF host-pinning. When set (even to an empty list), every outgoing request URL —
# including paginator next-page links and seeded resume URLs — must resolve to one of
# these hosts; the base_url host is always implicitly allowed. Off-host URLs are rejected
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/retry_limits.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/retry_limits.py
new file mode 100644
index 000000000000..5ee915ff786e
--- /dev/null
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/retry_limits.py
@@ -0,0 +1,11 @@
+from django.conf import settings
+
+
+def retry_budget_seconds() -> float:
+ """The longest time one request may spend on retries, from its first failure."""
+ return settings.DATA_WAREHOUSE_SOURCE_RETRY_BUDGET_SECONDS
+
+
+def max_retry_after_seconds() -> float:
+ """The longest server-provided retry delay that shared code waits for."""
+ return settings.DATA_WAREHOUSE_SOURCE_MAX_RETRY_AFTER_SECONDS
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/safe_point.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/safe_point.py
index b8ba0558504b..6480bbb009df 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/safe_point.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/safe_point.py
@@ -22,6 +22,7 @@ from contextvars import ContextVar
from posthog.dataclasses import frozen
SafePointHook = Callable[[], None]
+ShutdownSignal = Callable[[], bool]
@frozen
@@ -31,6 +32,9 @@ class _ActiveSafePoint:
# when the framework's own generator is what the pipeline iterates. A source that wraps it could
# buffer rows between the two, and the framework cannot see that buffer.
covers_framework_checkpoints: bool
+ # Tells a wait that the worker is shutting down. The pipeline sets it only for a run that it
+ # hands to another worker at the next item or safe point, so a wait may end early for it.
+ is_shutting_down: ShutdownSignal | None
_active_safe_point: ContextVar[_ActiveSafePoint | None] = ContextVar("warehouse_source_safe_point", default=None)
@@ -38,10 +42,16 @@ _safe_points_held: ContextVar[bool] = ContextVar("warehouse_source_safe_points_h
@contextmanager
-def activate_safe_point(hook: SafePointHook, *, covers_framework_checkpoints: bool) -> Iterator[None]:
+def activate_safe_point(
+ hook: SafePointHook, *, covers_framework_checkpoints: bool, is_shutting_down: ShutdownSignal | None = None
+) -> Iterator[None]:
"""Install `hook` for code that runs in this context, including source threads started in it."""
token = _active_safe_point.set(
- _ActiveSafePoint(hook=hook, covers_framework_checkpoints=covers_framework_checkpoints)
+ _ActiveSafePoint(
+ hook=hook,
+ covers_framework_checkpoints=covers_framework_checkpoints,
+ is_shutting_down=is_shutting_down,
+ )
)
try:
yield
@@ -80,3 +90,9 @@ def reach_framework_safe_point() -> None:
"""The REST framework's safe point, which applies only when nothing wraps the framework's output."""
if framework_checkpoints_are_covered():
reach_safe_point()
+
+
+def shutdown_signal() -> ShutdownSignal | None:
+ """The signal a wait polls to end early, or None when no run that can hand off is active."""
+ active = _active_safe_point.get()
+ return None if active is None else active.is_shutting_down
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/test/test_request_pacer.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/test/test_request_pacer.py
index 1482acff5e09..6f1b200b6e8a 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/test/test_request_pacer.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/test/test_request_pacer.py
@@ -1,6 +1,10 @@
import pytest
+from unittest.mock import patch
+
+from django.test import override_settings
from products.warehouse_sources.backend.temporal.data_imports.sources.common.request_pacer import RequestPacer
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.safe_point import activate_safe_point
class TestRequestPacer:
@@ -108,3 +112,28 @@ class TestRequestPacer:
# The 20s deadline stands: neither the shorter header nor the bare repeat moved it.
assert sleeps == []
+
+ @override_settings(DATA_WAREHOUSE_SOURCE_MAX_RETRY_AFTER_SECONDS=300.0)
+ def test_a_retry_after_above_the_limit_holds_for_the_limit(self) -> None:
+ pacer, clock, sleeps = self._pacer()
+
+ pacer.throttled(100_000.0)
+ pacer.throttled(200_000.0)
+ pacer.wait_turn()
+
+ assert sleeps == pytest.approx([300.0])
+
+ @pytest.mark.parametrize("shutting_down,expected_sleep", [(False, 60.0), (True, 0.0)])
+ def test_a_hold_ends_when_the_worker_shuts_down(self, shutting_down: bool, expected_sleep: float) -> None:
+ pacer = RequestPacer(10.0, clock=lambda: 0.0)
+ pacer.throttled(60.0)
+
+ with (
+ patch("time.sleep") as sleep,
+ activate_safe_point(
+ lambda: None, covers_framework_checkpoints=False, is_shutting_down=lambda: shutting_down
+ ),
+ ):
+ pacer.wait_turn()
+
+ assert sum(call.args[0] for call in sleep.call_args_list) == pytest.approx(expected_sleep)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/custom/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/custom/source.py
index 42241102f3d3..83a791deaa7a 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/custom/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/custom/source.py
@@ -189,6 +189,13 @@ class _ManifestAuth(BaseModel):
return self
+def _without_retry_limit_overrides(client: dict[str, Any]) -> dict[str, Any]:
+ """A user-authored manifest cannot raise the retry limits; only a trusted source definition can."""
+ return {
+ key: value for key, value in client.items() if key not in ("retry_budget_seconds", "retry_after_max_seconds")
+ }
+
+
class _ManifestClient(BaseModel):
base_url: str = Field(min_length=1)
auth: _ManifestAuth | None = None
@@ -1276,7 +1283,12 @@ class CustomSource(SimpleSource[CustomSourceConfig]):
_strip_engine_unsupported_incremental_keys(chosen),
]
engine_manifest = cast(
- RESTAPIConfig, {**manifest_without_default_incremental, "resources": engine_resources}
+ RESTAPIConfig,
+ {
+ **manifest_without_default_incremental,
+ "client": _without_retry_limit_overrides(manifest["client"]),
+ "resources": engine_resources,
+ },
)
# Backstop for manifests stored before create-time validation covered this: an
@@ -1456,7 +1468,7 @@ class CustomSource(SimpleSource[CustomSourceConfig]):
**_split_default_incremental(manifest)[0],
"resources": engine_resources,
"client": {
- **client,
+ **_without_retry_limit_overrides(client),
"session": _build_preview_session(secret_values),
# One attempt only — a rate-limited endpoint must surface an error
# inline, not sleep on `Retry-After` and tie up the request thread.
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/custom/test_custom_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/custom/test_custom_source.py
index 9301a86bd3d6..aef4fafe79df 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/custom/test_custom_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/custom/test_custom_source.py
@@ -1680,6 +1680,29 @@ class TestCustomSourceSourceForPipeline(SimpleTestCase):
with self.assertRaises(NonRetryableException):
source.source_for_pipeline(config, inputs)
+ @patch("products.warehouse_sources.backend.temporal.data_imports.sources.custom.source.rest_api_resources")
+ def test_manifest_cannot_raise_retry_limits(self, mock_resources):
+ # Fails if a user-authored manifest can set the retry limits, which would let its own endpoint
+ # hold a shared source thread for as long as it likes.
+ mock_resources.return_value = [_fake_resource("users")]
+ manifest = _minimal_manifest()
+ manifest["client"]["retry_budget_seconds"] = 172800
+ manifest["client"]["retry_after_max_seconds"] = 86400
+
+ inputs = MagicMock(
+ team_id=999,
+ schema_name="users",
+ job_id="job-1",
+ should_use_incremental_field=False,
+ db_incremental_field_last_value=None,
+ )
+ CustomSource().source_for_pipeline(CustomSourceConfig(manifest_json=json.dumps(manifest)), inputs)
+
+ client_config = mock_resources.call_args.args[0]["client"]
+ assert "retry_budget_seconds" not in client_config
+ assert "retry_after_max_seconds" not in client_config
+ assert client_config["base_url"] == manifest["client"]["base_url"]
+
@parameterized.expand(
[("default_asc", None, "asc"), ("explicit_asc", "asc", "asc"), ("explicit_desc", "desc", "desc")]
)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/sentry.py b/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/sentry.py
index 2ffa3da1e961..73d74eba74f5 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/sentry.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/sentry.py
@@ -63,7 +63,7 @@ _MAX_RETRIES = 3
# coverage the adapter provided.
_RETRYABLE_STATUS_CODES = (429, 500, 502, 503, 504, *CLOUDFLARE_TRANSIENT_STATUSES)
# Upper bound on a server-provided 429 wait, so a misreported Retry-After or reset header cannot
-# park a worker. Matches the shared REST client's MAX_RETRY_AFTER_SECONDS.
+# park a worker. Matches the default limit of the shared REST client.
_MAX_RETRY_AFTER_SECONDS = 300.0
# Safety bound for how many issues the issue_tag_values fan-out will skip while
# fast-forwarding to a saved checkpoint issue. If the checkpoint issue was
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/tests/source_contract_baseline.txt b/products/warehouse_sources/backend/temporal/data_imports/sources/tests/source_contract_baseline.txt
index abbbd55fa90d..5124a1d05eb9 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/tests/source_contract_baseline.txt
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/tests/source_contract_baseline.txt
@@ -1,35 +1,35 @@
-Ably fail:rate-limit-budget,stall-budget
-AbnormalSecurity fail:rate-limit-budget,stall-budget
-Acast fail:rate-limit-budget,stall-budget
-Acculynx fail:rate-limit-budget,stall-budget
-ActiveCampaign fail:rate-limit-budget,stall-budget
-AdRoll fail:rate-limit-budget,stall-budget
+Ably fail:stall-budget
+AbnormalSecurity fail:stall-budget
+Acast fail:stall-budget
+Acculynx fail:stall-budget
+ActiveCampaign fail:stall-budget
+AdRoll fail:stall-budget
Adjust fail:rate-limit-budget,safe-point,stall-budget
AdobeAnalytics fail:rate-limit-budget
AdobeCommerce fail:rate-limit-budget,stall-budget
Adyen fail:rate-limit-budget,safe-point,stall-budget
-Aftership fail:rate-limit-budget,stall-budget
-AgileCRM fail:rate-limit-budget,stall-budget
-Aha fail:rate-limit-budget,stall-budget
-AhaIdeas fail:rate-limit-budget,stall-budget
-Ahrefs fail:rate-limit-budget,stall-budget
-AirOps fail:rate-limit-budget,stall-budget
+Aftership fail:stall-budget
+AgileCRM fail:stall-budget
+Aha fail:stall-budget
+AhaIdeas fail:stall-budget
+Ahrefs fail:stall-budget
+AirOps fail:stall-budget
Airbrake fail:rate-limit-budget,stall-budget
-Aircall fail:rate-limit-budget,stall-budget
-Airtable fail:rate-limit-budget,stall-budget
-Airwallex fail:rate-limit-budget,stall-budget
-Aiven fail:rate-limit-budget,stall-budget
-Alegra fail:rate-limit-budget,stall-budget
-Algolia fail:rate-limit-budget,stall-budget
-Alguna fail:rate-limit-budget,stall-budget
+Aircall fail:stall-budget
+Airtable fail:stall-budget
+Airwallex fail:stall-budget
+Aiven fail:stall-budget
+Alegra fail:stall-budget
+Algolia fail:stall-budget
+Alguna fail:stall-budget
AlphaVantage fail:rate-limit-budget,stall-budget
AmazonAds fail:rate-limit-budget,stall-budget
-Amplemarket fail:rate-limit-budget,stall-budget
+Amplemarket fail:stall-budget
Amplitude fail:rate-limit-budget,stall-budget
-Anthropic fail:rate-limit-budget,safe-point,stall-budget
+Anthropic fail:safe-point,stall-budget
Anvil fail:rate-limit-budget
-ApifyDataset fail:rate-limit-budget,stall-budget
-Apitally fail:rate-limit-budget,stall-budget
+ApifyDataset fail:stall-budget
+Apitally fail:stall-budget
Apollo fail:rate-limit-budget,stall-budget
AppLovin fail:rate-limit-budget,safe-point,stall-budget
AppStoreConnect not-checkable:no-request
@@ -39,22 +39,21 @@ Appfollow fail:rate-limit-budget,stall-budget
AppleSearchAds not-checkable:no-request
AppsFlyer fail:rate-limit-budget,safe-point,stall-budget
Appsignal fail:safe-point,stall-budget
-Appstack fail:rate-limit-budget,stall-budget
-Arcade fail:rate-limit-budget,stall-budget
+Appstack fail:stall-budget
Argocd fail:stall-budget
-Asaas fail:rate-limit-budget,stall-budget
-Asana fail:rate-limit-budget,stall-budget
-Ashby fail:rate-limit-budget,stall-budget
-Asknicely fail:rate-limit-budget,stall-budget
-AssemblyAI fail:rate-limit-budget,stall-budget
-Astronomer fail:rate-limit-budget,stall-budget
+Asaas fail:stall-budget
+Asana fail:stall-budget
+Ashby fail:stall-budget
+Asknicely fail:stall-budget
+AssemblyAI fail:stall-budget
+Astronomer fail:stall-budget
Attentive not-checkable:database
-Attio fail:rate-limit-budget,stall-budget
+Attio fail:stall-budget
Auth0 fail:rate-limit-budget
Automox fail:rate-limit-budget,stall-budget
-Autumn fail:rate-limit-budget,stall-budget
-Avalara fail:rate-limit-budget,stall-budget
-Aviationstack fail:rate-limit-budget,stall-budget
+Autumn fail:stall-budget
+Avalara fail:stall-budget
+Aviationstack fail:stall-budget
Aviator fail:rate-limit-budget,stall-budget
Awin fail:rate-limit-budget,stall-budget
AwsBatch fail:rate-limit-budget
@@ -77,133 +76,124 @@ AwsSes fail:rate-limit-budget,stall-budget
AwsStepFunctions fail:rate-limit-budget
AwsSystemsManager fail:rate-limit-budget
AwsWaf fail:stall-budget
-Axiom fail:rate-limit-budget,stall-budget
-AzureApplicationInsights fail:rate-limit-budget,stall-budget
+AzureApplicationInsights fail:stall-budget
AzureCostManagement not-checkable:no-request
AzureDevOps fail:rate-limit-budget,stall-budget
-Babelforce fail:rate-limit-budget,stall-budget
-BackMarket fail:rate-limit-budget,stall-budget
-BambooHR fail:rate-limit-budget,stall-budget
+Babelforce fail:stall-budget
+BackMarket fail:stall-budget
+BambooHR fail:stall-budget
Baserow not-checkable:schemas
-Baseten fail:rate-limit-budget,stall-budget
-Beamer fail:rate-limit-budget,stall-budget
-Beehiiv fail:rate-limit-budget,stall-budget
-BetterStack fail:rate-limit-budget,stall-budget
-BigCommerce fail:rate-limit-budget,stall-budget
-BigMailer fail:rate-limit-budget,safe-point,stall-budget
+Baseten fail:stall-budget
+Beamer fail:stall-budget
+BetterStack fail:stall-budget
+BigCommerce fail:stall-budget
+BigMailer fail:safe-point,stall-budget
BigQuery not-checkable:driver:google.cloud
-Bigeye fail:rate-limit-budget,stall-budget
-Billomat fail:rate-limit-budget,stall-budget
+Bigeye fail:stall-budget
+Billomat fail:stall-budget
BingAds not-checkable:database
BingWebmasterTools fail:rate-limit-budget
Bitbucket fail:rate-limit-budget,safe-point,stall-budget
-Bitrise fail:rate-limit-budget,stall-budget
-BlandAI fail:rate-limit-budget,stall-budget
-Blogger fail:rate-limit-budget,stall-budget
-Bloomerang fail:rate-limit-budget,stall-budget
-Bluesky fail:rate-limit-budget,stall-budget
-Bluetally fail:rate-limit-budget,stall-budget
-BoldSign fail:rate-limit-budget,stall-budget
+Bitrise fail:stall-budget
+BlandAI fail:stall-budget
+Blogger fail:stall-budget
+Bloomerang fail:stall-budget
+Bluesky fail:stall-budget
+Bluetally fail:stall-budget
+BoldSign fail:stall-budget
Braintree fail:stall-budget
-Braintrust fail:rate-limit-budget,stall-budget
-Braze fail:rate-limit-budget,stall-budget
+Braintrust fail:stall-budget
+Braze fail:stall-budget
Breezometer not-checkable:no-request
-Brevo fail:rate-limit-budget,stall-budget
-Brex fail:rate-limit-budget,stall-budget
-BrowseAI fail:rate-limit-budget,stall-budget
-BrowserUse fail:rate-limit-budget,stall-budget
-Browserbase fail:rate-limit-budget,stall-budget
-Bugherd fail:rate-limit-budget,stall-budget
+Brevo fail:stall-budget
+Brex fail:stall-budget
+BrowserUse fail:stall-budget
+Browserbase fail:stall-budget
+Bugherd fail:stall-budget
Bugsnag fail:rate-limit-budget,safe-point,stall-budget
-Buildium fail:rate-limit-budget,stall-budget
-Buildkite fail:rate-limit-budget,stall-budget
-Bunny fail:rate-limit-budget,stall-budget
-Buttondown fail:rate-limit-budget,stall-budget
-BuyMeACoffee fail:rate-limit-budget,stall-budget
-Buzzsprout fail:rate-limit-budget,stall-budget
-CalCom fail:rate-limit-budget,safe-point,stall-budget
-Calendarific fail:rate-limit-budget,stall-budget
+Buildkite fail:stall-budget
+Bunny fail:stall-budget
+Buttondown fail:stall-budget
+Buzzsprout fail:stall-budget
+CalCom fail:safe-point,stall-budget
Calendly fail:rate-limit-budget
-CallRail fail:rate-limit-budget,stall-budget
-CampaignMonitor fail:rate-limit-budget,stall-budget
-Campayn fail:rate-limit-budget,stall-budget
-Campfire fail:rate-limit-budget,stall-budget
-Canny fail:rate-limit-budget,stall-budget
-CanvasLms fail:rate-limit-budget,safe-point,stall-budget
-CapsuleCRM fail:rate-limit-budget,stall-budget
+CallRail fail:stall-budget
+CampaignMonitor fail:stall-budget
+Campayn fail:stall-budget
+Campfire fail:stall-budget
+Canny fail:stall-budget
+CanvasLms fail:safe-point
+CapsuleCRM fail:stall-budget
CareQualityCommission fail:rate-limit-budget,stall-budget
-CastAi fail:rate-limit-budget,stall-budget
-Catchpoint fail:rate-limit-budget,stall-budget
-CdcOpenData fail:rate-limit-budget,stall-budget
-Census fail:rate-limit-budget,stall-budget
-Chameleon fail:rate-limit-budget,stall-budget
-Chargebee fail:rate-limit-budget,stall-budget
-Chargedesk fail:rate-limit-budget,stall-budget
-Chargify fail:rate-limit-budget,stall-budget
+CastAi fail:stall-budget
+CdcOpenData fail:stall-budget
+Census fail:stall-budget
+Chameleon fail:stall-budget
+Chargebee fail:stall-budget
+Chargedesk fail:stall-budget
+Chargify fail:stall-budget
ChartHop fail:rate-limit-budget
-ChartMogul fail:rate-limit-budget,stall-budget
+ChartMogul fail:stall-budget
Chatwoot not-checkable:database
-Checkly fail:rate-limit-budget,stall-budget
+Checkly fail:stall-budget
Checkmarx fail:rate-limit-budget,stall-budget
-CheckoutCom fail:rate-limit-budget,stall-budget
-Churnkey fail:rate-limit-budget,stall-budget
+CheckoutCom fail:stall-budget
+Churnkey fail:stall-budget
Cimis fail:rate-limit-budget,stall-budget
CircleCI fail:rate-limit-budget,safe-point,stall-budget
CircleciInsights fail:rate-limit-budget,safe-point,stall-budget
CiscoDuo not-checkable:no-request
-CiscoMeraki fail:rate-limit-budget,stall-budget
+CiscoMeraki fail:stall-budget
Clari fail:stall-budget
-Clarifai fail:rate-limit-budget,stall-budget
+Clarifai fail:stall-budget
Clay not-checkable:schemas
-Clerk fail:rate-limit-budget,stall-budget
-Clever fail:rate-limit-budget,stall-budget
+Clerk fail:stall-budget
+Clever fail:stall-budget
ClickHouse not-checkable:schemas
-ClickUp fail:rate-limit-budget,stall-budget
+ClickUp fail:stall-budget
ClickhouseCloud fail:rate-limit-budget,stall-budget
-Cliniko fail:rate-limit-budget,stall-budget
-Clip fail:rate-limit-budget,stall-budget
-Clockify fail:rate-limit-budget,stall-budget
-Clockodo fail:rate-limit-budget,stall-budget
+Cliniko fail:stall-budget
+Clockify fail:stall-budget
+Clockodo fail:stall-budget
Close fail:rate-limit-budget
-Cloudability fail:rate-limit-budget,stall-budget
-Cloudbeds fail:rate-limit-budget,stall-budget
-Cloudflare fail:rate-limit-budget,stall-budget
-Cloudinary fail:rate-limit-budget,stall-budget
-Cloudsmith fail:rate-limit-budget,stall-budget
-Cloudzero fail:rate-limit-budget,stall-budget
-Coassemble fail:rate-limit-budget,stall-budget
-Coda fail:rate-limit-budget,safe-point,stall-budget
+Cloudability fail:stall-budget
+Cloudbeds fail:stall-budget
+Cloudflare fail:stall-budget
+Cloudinary fail:stall-budget
+Cloudsmith fail:stall-budget
+Cloudzero fail:stall-budget
+Coassemble fail:stall-budget
+Coda fail:safe-point,stall-budget
Codacy fail:rate-limit-budget,stall-budget
Codecov fail:rate-limit-budget,safe-point,stall-budget
-Codefresh fail:rate-limit-budget,stall-budget
-Codemagic fail:rate-limit-budget,stall-budget
-Codescene fail:rate-limit-budget,stall-budget
+Codefresh fail:stall-budget
+Codemagic fail:stall-budget
+Codescene fail:stall-budget
Cody fail:stall-budget
-Cohere fail:rate-limit-budget,stall-budget
+Cohere fail:stall-budget
CoinApi fail:rate-limit-budget,stall-budget
-CoinGecko fail:rate-limit-budget,stall-budget
-CoinMarketCap fail:rate-limit-budget,safe-point,stall-budget
+CoinGecko fail:stall-budget
+CoinMarketCap fail:safe-point,stall-budget
Commercetools fail:rate-limit-budget,stall-budget
-Companycam fail:rate-limit-budget,stall-budget
+Companycam fail:stall-budget
Concord fail:rate-limit-budget,stall-budget
-Conekta fail:rate-limit-budget,stall-budget
-ConfigCat fail:rate-limit-budget,stall-budget
-Confluence fail:rate-limit-budget,stall-budget
+Conekta fail:stall-budget
+ConfigCat fail:stall-budget
+Confluence fail:stall-budget
ConfluentCloud fail:rate-limit-budget,stall-budget
-ConvertKit fail:rate-limit-budget,stall-budget
+ConvertKit fail:stall-budget
Convex not-checkable:schemas
-Coolify fail:rate-limit-budget,stall-budget
-Copper fail:rate-limit-budget,stall-budget
+Copper fail:stall-budget
Coralogix fail:stall-budget
-Cortex fail:rate-limit-budget,stall-budget
+Cortex fail:stall-budget
Coupa fail:rate-limit-budget,stall-budget
-Courier fail:rate-limit-budget,stall-budget
+Courier fail:stall-budget
Coveralls not-checkable:no-request
CratesIO fail:rate-limit-budget,stall-budget
Cronitor fail:rate-limit-budget,stall-budget
Crossref fail:rate-limit-budget
-Crunchbase fail:rate-limit-budget,stall-budget
-CultureAmp fail:rate-limit-budget,stall-budget
+Crunchbase fail:stall-budget
+CultureAmp fail:stall-budget
Cursor fail:safe-point,stall-budget
Custom not-checkable:schemas
CustomerIO fail:rate-limit-budget,stall-budget
@@ -216,115 +206,112 @@ Datahub fail:rate-limit-budget,stall-budget
Dbt fail:rate-limit-budget,stall-budget
Debugbear fail:rate-limit-budget
Decagon fail:rate-limit-budget,stall-budget
-Deel fail:rate-limit-budget,stall-budget
-Deepgram fail:rate-limit-budget,stall-budget
+Deel fail:stall-budget
+Deepgram fail:stall-budget
Deepsource fail:rate-limit-budget,stall-budget
-Demodesk fail:rate-limit-budget,stall-budget
-DenoDeploy fail:rate-limit-budget,stall-budget
+Demodesk fail:stall-budget
+DenoDeploy fail:stall-budget
Depot not-checkable:no-request
-Descope fail:rate-limit-budget,stall-budget
-Develocity fail:rate-limit-budget,stall-budget
-DevinAI fail:rate-limit-budget,stall-budget
-DigitalOcean fail:rate-limit-budget,stall-budget
-DingConnect fail:rate-limit-budget,stall-budget
-Discourse fail:rate-limit-budget,safe-point,stall-budget
+Descope fail:stall-budget
+Develocity fail:stall-budget
+DevinAI fail:stall-budget
+DigitalOcean fail:stall-budget
+DingConnect fail:stall-budget
+Discourse fail:safe-point
Dixa fail:rate-limit-budget,safe-point,stall-budget
DoIt not-checkable:schemas
Dockerhub fail:rate-limit-budget,safe-point,stall-budget
-Docuseal fail:rate-limit-budget,stall-budget
+Docuseal fail:stall-budget
Docusign not-checkable:no-request
-DodoPayments fail:rate-limit-budget,stall-budget
-Donorbox fail:rate-limit-budget,stall-budget
+DodoPayments fail:stall-budget
Doppler fail:rate-limit-budget,stall-budget
-Dovetail fail:rate-limit-budget,stall-budget
-Drata fail:rate-limit-budget,stall-budget
-Drip fail:rate-limit-budget,stall-budget
+Dovetail fail:stall-budget
+Drata fail:stall-budget
DropboxSign fail:rate-limit-budget,stall-budget
Dub fail:rate-limit-budget,stall-budget
Dynamics365 not-checkable:no-request
-Dynamics365BusinessCentral fail:rate-limit-budget,stall-budget
+Dynamics365BusinessCentral fail:stall-budget
DynamoDB not-checkable:schemas
-Dynatrace fail:rate-limit-budget,stall-budget
-E2B fail:rate-limit-budget,stall-budget
-EConomic fail:rate-limit-budget,stall-budget
-EZOfficeInventory fail:rate-limit-budget,stall-budget
-Easybill fail:rate-limit-budget,stall-budget
+Dynatrace fail:stall-budget
+E2B fail:stall-budget
+EConomic fail:stall-budget
+EZOfficeInventory fail:stall-budget
+Easybill fail:stall-budget
Easypost fail:rate-limit-budget,stall-budget
-Easypromos fail:rate-limit-budget,stall-budget
+Easypromos fail:stall-budget
EcbDataPortal fail:rate-limit-budget,safe-point,stall-budget
-Elasticemail fail:rate-limit-budget,stall-budget
+Elasticemail fail:stall-budget
Elasticsearch not-checkable:schemas
-ElectricityMaps fail:rate-limit-budget,stall-budget
-ElevenLabs fail:rate-limit-budget,stall-budget
-EmailOctopus fail:rate-limit-budget,stall-budget
-Embrace fail:rate-limit-budget,stall-budget
-Env0 fail:rate-limit-budget,stall-budget
-Eppo fail:rate-limit-budget,stall-budget
+ElectricityMaps fail:stall-budget
+ElevenLabs fail:stall-budget
+EmailOctopus fail:stall-budget
+Embrace fail:stall-budget
+Env0 fail:stall-budget
+Eppo fail:stall-budget
Etsy fail:rate-limit-budget
-Eventbrite fail:rate-limit-budget,stall-budget
-Eventee fail:rate-limit-budget,stall-budget
-Eventzilla fail:rate-limit-budget,stall-budget
+Eventbrite fail:stall-budget
+Eventee fail:stall-budget
+Eventzilla fail:stall-budget
Everhour fail:rate-limit-budget,stall-budget
ExchangeRatesApi fail:rate-limit-budget,stall-budget
-Factorial fail:rate-limit-budget,stall-budget
-Faire fail:rate-limit-budget,stall-budget
+Factorial fail:stall-budget
+Faire fail:stall-budget
Fastly fail:rate-limit-budget,safe-point,stall-budget
Featurebase not-checkable:database
-Fieldpulse fail:rate-limit-budget,stall-budget
-Fillout fail:rate-limit-budget,stall-budget
+Fieldpulse fail:stall-budget
+Fillout fail:stall-budget
Finage fail:stall-budget
FinancialModelling fail:rate-limit-budget,safe-point,stall-budget
Finnhub fail:rate-limit-budget,stall-budget
Finnworlds fail:rate-limit-budget,stall-budget
Fintoc not-checkable:database
-FireHydrant fail:rate-limit-budget,stall-budget
+FireHydrant fail:stall-budget
Firebase not-checkable:schemas
-Firecrawl fail:rate-limit-budget,stall-budget
-FireworksAI fail:rate-limit-budget,stall-budget
-FirstPromoter fail:rate-limit-budget,stall-budget
+Firecrawl fail:stall-budget
+FireworksAI fail:stall-budget
+FirstPromoter fail:stall-budget
Flagsmith fail:safe-point,stall-budget
-Fleetio fail:rate-limit-budget,stall-budget
-Flexmail fail:rate-limit-budget,stall-budget
-FloatApp fail:rate-limit-budget,stall-budget
-Flowlu fail:rate-limit-budget,stall-budget
-Flutterwave fail:rate-limit-budget,stall-budget
-FlyIo fail:rate-limit-budget,stall-budget
-Folk fail:rate-limit-budget,stall-budget
+Fleetio fail:stall-budget
+Flexmail fail:stall-budget
+FloatApp fail:stall-budget
+Flowlu fail:stall-budget
+Flutterwave fail:stall-budget
+FlyIo fail:stall-budget
+Folk fail:stall-budget
Formbricks fail:rate-limit-budget,safe-point,stall-budget
-Fourthwall fail:rate-limit-budget,stall-budget
Framer not-checkable:no-request
Fred fail:rate-limit-budget
-Freshcaller fail:rate-limit-budget,stall-budget
-Freshchat fail:rate-limit-budget,stall-budget
-Freshdesk fail:rate-limit-budget,stall-budget
+Freshcaller fail:stall-budget
+Freshchat fail:stall-budget
+Freshdesk fail:stall-budget
Freshsales fail:rate-limit-budget,stall-budget
-Freshservice fail:rate-limit-budget,stall-budget
+Freshservice fail:stall-budget
Frill fail:rate-limit-budget,stall-budget
-Front fail:rate-limit-budget,stall-budget
-Frontegg fail:rate-limit-budget,stall-budget
-Fulcrum fail:rate-limit-budget,stall-budget
-FullStory fail:rate-limit-budget,stall-budget
-FusionAuth fail:rate-limit-budget,stall-budget
+Front fail:stall-budget
+Frontegg fail:stall-budget
+Fulcrum fail:stall-budget
+FullStory fail:stall-budget
+FusionAuth fail:stall-budget
G2 fail:rate-limit-budget,safe-point
GNews fail:rate-limit-budget,stall-budget
GainsightCs fail:rate-limit-budget
-GainsightPx fail:rate-limit-budget,safe-point,stall-budget
-Gcore fail:rate-limit-budget,stall-budget
+GainsightPx fail:safe-point,stall-budget
+Gcore fail:stall-budget
Gerrit fail:rate-limit-budget,stall-budget
-Getdx fail:rate-limit-budget,stall-budget
-Giphy fail:rate-limit-budget,stall-budget
-GitBook fail:rate-limit-budget,stall-budget
+Getdx fail:stall-budget
+Giphy fail:stall-budget
+GitBook fail:stall-budget
GitLab fail:rate-limit-budget,stall-budget
Gitea fail:rate-limit-budget,stall-budget
Gitguardian fail:rate-limit-budget,safe-point,stall-budget
Github not-checkable:schemas
-Givebutter fail:rate-limit-budget,stall-budget
+Givebutter fail:stall-budget
Gladly fail:rate-limit-budget,stall-budget
-Glassfrog fail:rate-limit-budget,stall-budget
-Gleif fail:rate-limit-budget,stall-budget
-GoCardless fail:rate-limit-budget,stall-budget
-GoLogin fail:rate-limit-budget,stall-budget
-Goldcast fail:rate-limit-budget,stall-budget
+Glassfrog fail:stall-budget
+Gleif fail:stall-budget
+GoCardless fail:stall-budget
+GoLogin fail:stall-budget
+Goldcast fail:stall-budget
Gong fail:rate-limit-budget,stall-budget
GoogleAds not-checkable:driver:google.ads
GoogleAnalytics not-checkable:database
@@ -332,529 +319,501 @@ GooglePageSpeedInsights fail:stall-budget
GooglePlayConsole not-checkable:no-request
GoogleSearchConsole not-checkable:database
GoogleSheets not-checkable:schemas
-GoogleWebfonts fail:rate-limit-budget,stall-budget
+GoogleWebfonts fail:stall-budget
Gorgias fail:rate-limit-budget,stall-budget
Grafana fail:stall-budget
GrafanaIRM not-checkable:no-request
-Granola fail:rate-limit-budget,stall-budget
-Greenhouse fail:rate-limit-budget,stall-budget
+Granola fail:stall-budget
+Greenhouse fail:stall-budget
Gridly fail:rate-limit-budget,stall-budget
-Groq fail:rate-limit-budget,safe-point,stall-budget
-GrowthBook fail:rate-limit-budget,stall-budget
-Guardian fail:rate-limit-budget,stall-budget
-Gumroad fail:rate-limit-budget,stall-budget
-Guru fail:rate-limit-budget,stall-budget
+Groq fail:safe-point,stall-budget
+Guardian fail:stall-budget
+Guru fail:stall-budget
Gusto fail:rate-limit-budget
-Harness fail:rate-limit-budget,stall-budget
-Harvest fail:rate-limit-budget,stall-budget
+Harness fail:stall-budget
+Harvest fail:stall-budget
Harvey fail:rate-limit-budget,stall-budget
Hatchet not-checkable:no-request
Healthchecks fail:rate-limit-budget,stall-budget
-Height fail:rate-limit-budget,stall-budget
+Height fail:stall-budget
Helicone fail:stall-budget
-Hellobaton fail:rate-limit-budget,stall-budget
+Hellobaton fail:stall-budget
HelpScout not-checkable:database
-Heroku fail:rate-limit-budget,stall-budget
-Hetzner fail:rate-limit-budget,stall-budget
-Hex fail:rate-limit-budget,stall-budget
-HeyGen fail:rate-limit-budget,stall-budget
-HeyReach fail:rate-limit-budget,stall-budget
-HiBob fail:rate-limit-budget,stall-budget
-Hightouch fail:rate-limit-budget,stall-budget
-Hitpay fail:rate-limit-budget,safe-point,stall-budget
+Heroku fail:stall-budget
+Hetzner fail:stall-budget
+Hex fail:stall-budget
+HeyGen fail:stall-budget
+HeyReach fail:stall-budget
+HiBob fail:stall-budget
+Hightouch fail:stall-budget
+Hitpay fail:safe-point,stall-budget
Honeybadger fail:rate-limit-budget,safe-point,stall-budget
Honeycomb fail:rate-limit-budget,stall-budget
-Hookdeck fail:rate-limit-budget,stall-budget
-HoorayHR fail:rate-limit-budget,stall-budget
-HousecallPro fail:rate-limit-budget,stall-budget
-Hubplanner fail:rate-limit-budget,stall-budget
+Hookdeck fail:stall-budget
+HoorayHR fail:stall-budget
+HousecallPro fail:stall-budget
+Hubplanner fail:stall-budget
Hubspot not-checkable:database
-HuggingFace fail:rate-limit-budget,stall-budget
-Humanitec fail:rate-limit-budget,stall-budget
-Humanitix fail:rate-limit-budget,stall-budget
-Huntr fail:rate-limit-budget,stall-budget
+HuggingFace fail:stall-budget
+Humanitec fail:stall-budget
+Humanitix fail:stall-budget
+Huntr fail:stall-budget
Hyperspell fail:rate-limit-budget,safe-point,stall-budget
-Hyros fail:rate-limit-budget,stall-budget
+Hyros fail:stall-budget
IP2Whois fail:rate-limit-budget,stall-budget
-Imagga fail:rate-limit-budget,stall-budget
+Imagga fail:stall-budget
Impact fail:rate-limit-budget
ImpactPartner fail:rate-limit-budget
-Imperva fail:rate-limit-budget,stall-budget
-IncidentIo fail:rate-limit-budget,stall-budget
-Inflowinventory fail:rate-limit-budget,stall-budget
+Imperva fail:stall-budget
+IncidentIo fail:stall-budget
+Inflowinventory fail:stall-budget
Inngest fail:rate-limit-budget,stall-budget
-Insightly fail:rate-limit-budget,stall-budget
+Insightly fail:stall-budget
Instagram not-checkable:database
Instana fail:rate-limit-budget,safe-point,stall-budget
-Instantly fail:rate-limit-budget,stall-budget
-Instatus fail:rate-limit-budget,stall-budget
+Instantly fail:stall-budget
+Instatus fail:stall-budget
Intercom not-checkable:database
-Intruder fail:rate-limit-budget,stall-budget
-Invoiced fail:rate-limit-budget,stall-budget
-Invoiceninja fail:rate-limit-budget,stall-budget
-Iterable fail:rate-limit-budget,stall-budget
+Intruder fail:stall-budget
+Invoiced fail:stall-budget
+Invoiceninja fail:stall-budget
+Iterable fail:stall-budget
JamfPro fail:rate-limit-budget,stall-budget
Jellyfish fail:stall-budget
Jenkins fail:rate-limit-budget,stall-budget
JfrogArtifactory fail:rate-limit-budget,stall-budget
-Jira fail:rate-limit-budget,stall-budget
-JobNimbus fail:rate-limit-budget,stall-budget
-Jotform fail:rate-limit-budget,stall-budget
-JudgeMeReviews fail:rate-limit-budget,stall-budget
+Jira fail:stall-budget
+JobNimbus fail:stall-budget
+Jotform fail:stall-budget
+JudgeMeReviews fail:stall-budget
Jumpcloud fail:rate-limit-budget,stall-budget
-JustCall fail:rate-limit-budget,stall-budget
-JustSift fail:rate-limit-budget,stall-budget
-K6Cloud fail:rate-limit-budget,stall-budget
+JustCall fail:stall-budget
+JustSift fail:stall-budget
+K6Cloud fail:stall-budget
Kafka not-checkable:driver:confluent_kafka
-Kalshi fail:rate-limit-budget,stall-budget
-Kandji fail:rate-limit-budget,safe-point,stall-budget
-KapaAI fail:rate-limit-budget,safe-point,stall-budget
-Katana fail:rate-limit-budget,stall-budget
+Kalshi fail:stall-budget
+Kandji fail:safe-point,stall-budget
+KapaAI fail:safe-point,stall-budget
+Katana fail:stall-budget
Kernel fail:rate-limit-budget,safe-point,stall-budget
Kestra not-checkable:no-request
-Kickscale fail:rate-limit-budget,stall-budget
-Kisi fail:rate-limit-budget,stall-budget
+Kickscale fail:stall-budget
Klaus fail:rate-limit-budget,stall-budget
Klaviyo fail:rate-limit-budget,safe-point,stall-budget
-Knock fail:rate-limit-budget,stall-budget
-Knowbe4 fail:rate-limit-budget,stall-budget
-Kommo fail:rate-limit-budget,stall-budget
-Komodor fail:rate-limit-budget,stall-budget
+Knock fail:stall-budget
+Knowbe4 fail:stall-budget
+Kommo fail:stall-budget
+Komodor fail:stall-budget
KongKonnect fail:stall-budget
-Koyeb fail:rate-limit-budget,stall-budget
+Koyeb fail:stall-budget
Kubecost fail:rate-limit-budget,stall-budget
-Kustomer fail:rate-limit-budget,stall-budget
+Kustomer fail:stall-budget
Lacework fail:rate-limit-budget,safe-point,stall-budget
-Lago fail:rate-limit-budget,stall-budget
-LambdaLabs fail:rate-limit-budget,stall-budget
+Lago fail:stall-budget
+LambdaLabs fail:stall-budget
LangSmith fail:rate-limit-budget,stall-budget
Langfuse fail:rate-limit-budget,stall-budget
-Lattice fail:rate-limit-budget,stall-budget
-LaunchDarkly fail:rate-limit-budget,stall-budget
-Leadfeeder fail:rate-limit-budget,stall-budget
-Leexi fail:rate-limit-budget,stall-budget
-Lemlist fail:rate-limit-budget,stall-budget
-LemonSqueezy fail:rate-limit-budget,stall-budget
-LessAnnoyingCRM fail:rate-limit-budget,stall-budget
-Lever fail:rate-limit-budget,stall-budget
-LexwareOffice fail:rate-limit-budget,stall-budget
-Lightdash fail:rate-limit-budget,stall-budget
-Lightfield fail:rate-limit-budget,stall-budget
-LightspeedRetail fail:rate-limit-budget,stall-budget
+Lattice fail:stall-budget
+LaunchDarkly fail:stall-budget
+Leadfeeder fail:stall-budget
+Leexi fail:stall-budget
+Lemlist fail:stall-budget
+LemonSqueezy fail:stall-budget
+LessAnnoyingCRM fail:stall-budget
+Lever fail:stall-budget
+LexwareOffice fail:stall-budget
+Lightdash fail:stall-budget
+Lightfield fail:stall-budget
+LightspeedRetail fail:stall-budget
Linear not-checkable:database
Linearb fail:rate-limit-budget,stall-budget
-LingoDev fail:rate-limit-budget,stall-budget
+LingoDev fail:stall-budget
LinkedinAds not-checkable:database
Linkrunner fail:rate-limit-budget,stall-budget
-Linode fail:rate-limit-budget,stall-budget
+Linode fail:stall-budget
LlamaCloud fail:rate-limit-budget,safe-point,stall-budget
Lob fail:rate-limit-budget,stall-budget
-Lodgify fail:rate-limit-budget,stall-budget
+Lodgify fail:stall-budget
Logicmonitor not-checkable:no-request
LogzIO fail:stall-budget
-LoopReturns fail:rate-limit-budget,stall-budget
-Loops fail:rate-limit-budget,stall-budget
-Lovable fail:rate-limit-budget,safe-point,stall-budget
+LoopReturns fail:stall-budget
+Loops fail:stall-budget
+Lovable fail:safe-point
Luma fail:rate-limit-budget,safe-point,stall-budget
MSSQL not-checkable:driver:pymssql
-Mailchimp fail:rate-limit-budget,stall-budget
-MailerLite fail:rate-limit-budget,stall-budget
-MailerSend fail:rate-limit-budget,safe-point,stall-budget
+Mailchimp fail:stall-budget
+MailerLite fail:stall-budget
+MailerSend fail:safe-point,stall-budget
Mailgun fail:rate-limit-budget,stall-budget
-Mailjet fail:rate-limit-budget,stall-budget
-Mailosaur fail:rate-limit-budget,stall-budget
-Mailtrap fail:rate-limit-budget,stall-budget
+Mailjet fail:stall-budget
+Mailosaur fail:stall-budget
+Mailtrap fail:stall-budget
Marketo fail:rate-limit-budget,stall-budget
-Marketstack fail:rate-limit-budget,stall-budget
+Marketstack fail:stall-budget
Matomo fail:stall-budget
-Maxio fail:rate-limit-budget,stall-budget
-Medusa fail:rate-limit-budget,stall-budget
-Mem0 fail:rate-limit-budget,safe-point,stall-budget
-Membrain fail:rate-limit-budget,stall-budget
+Maxio fail:stall-budget
+Medusa fail:stall-budget
+Mem0 fail:safe-point,stall-budget
+Membrain fail:stall-budget
Mention fail:rate-limit-budget,safe-point,stall-budget
-MercadoPago fail:rate-limit-budget,stall-budget
-Mercury fail:rate-limit-budget,stall-budget
+Mercury fail:stall-budget
MetaAds not-checkable:database
-Metabase fail:rate-limit-budget,stall-budget
+Metabase fail:stall-budget
Metaplane fail:rate-limit-budget,stall-budget
Meteostat fail:rate-limit-budget,safe-point
-Metorial fail:rate-limit-budget,stall-budget
-Metronome fail:rate-limit-budget,stall-budget
-Mezmo fail:rate-limit-budget,stall-budget
+Metorial fail:stall-budget
+Mezmo fail:stall-budget
MicrosoftClarity fail:rate-limit-budget
-MicrosoftDefenderCloudApps fail:rate-limit-budget,stall-budget
-MightyNetworks fail:rate-limit-budget,stall-budget
-Mintlify fail:rate-limit-budget,stall-budget
+MicrosoftDefenderCloudApps fail:stall-budget
+MightyNetworks fail:stall-budget
MistralAI fail:rate-limit-budget,stall-budget
-MixMax fail:rate-limit-budget,stall-budget
+MixMax fail:stall-budget
Mixpanel fail:rate-limit-budget,stall-budget
-MoEngage fail:rate-limit-budget,safe-point,stall-budget
+MoEngage fail:safe-point,stall-budget
Modal not-checkable:driver:grpclib
-Mollie fail:rate-limit-budget,stall-budget
+Mollie fail:stall-budget
Monday fail:stall-budget
MongoDB not-checkable:driver:pymongo
-Mono fail:rate-limit-budget,stall-budget
+Mono fail:stall-budget
MonteCarlo fail:safe-point,stall-budget
Motherduck not-checkable:driver:duckdb
-Motion fail:rate-limit-budget,stall-budget
-Moxie fail:rate-limit-budget,stall-budget
-Mux fail:rate-limit-budget,stall-budget
-MyHours fail:rate-limit-budget,safe-point,stall-budget
+Moxie fail:stall-budget
+Mux fail:stall-budget
+MyHours fail:safe-point,stall-budget
MySQL not-checkable:driver:psycopg
-N8n fail:rate-limit-budget,stall-budget
+N8n fail:stall-budget
NagerDate fail:rate-limit-budget
NebiusAI fail:rate-limit-budget,stall-budget
Neo4j not-checkable:schemas
Neon not-checkable:driver:psycopg
-Netlify fail:rate-limit-budget,stall-budget
+Netlify fail:stall-budget
NewRelic fail:safe-point,stall-budget
NewYorkTimes fail:rate-limit-budget,stall-budget
-NewsApi fail:rate-limit-budget,stall-budget
-NewsData fail:rate-limit-budget,stall-budget
-NoCRM fail:rate-limit-budget,stall-budget
-NoaaCdo fail:rate-limit-budget,stall-budget
+NewsApi fail:stall-budget
+NewsData fail:stall-budget
+NoCRM fail:stall-budget
+NoaaCdo fail:stall-budget
Northflank fail:rate-limit-budget,stall-budget
-NorthpassLMS fail:rate-limit-budget,stall-budget
+NorthpassLMS fail:stall-budget
Notion fail:rate-limit-budget,safe-point,stall-budget
NpmRegistry fail:rate-limit-budget,safe-point
Nuget fail:rate-limit-budget,stall-budget
-Nuntly fail:rate-limit-budget,stall-budget
-OPUSWatch fail:rate-limit-budget,stall-budget
-Octolens fail:rate-limit-budget,stall-budget
+Nuntly fail:stall-budget
+OPUSWatch fail:stall-budget
+Octolens fail:stall-budget
OctopusDeploy fail:stall-budget
-Okendo fail:rate-limit-budget,stall-budget
-Okta fail:rate-limit-budget,stall-budget
-Omni fail:rate-limit-budget,stall-budget
-Omnisend fail:rate-limit-budget,stall-budget
-Oncehub fail:rate-limit-budget,stall-budget
-OneHundredMs fail:rate-limit-budget,stall-budget
-OnePassword fail:rate-limit-budget,stall-budget
-Onepagecrm fail:rate-limit-budget,stall-budget
-Onfleet fail:rate-limit-budget,stall-budget
-OpenAI fail:rate-limit-budget,stall-budget
-OpenAIAds fail:rate-limit-budget,stall-budget
-OpenAQ fail:rate-limit-budget,stall-budget
+Okendo fail:stall-budget
+Okta fail:stall-budget
+Omni fail:stall-budget
+Omnisend fail:stall-budget
+Oncehub fail:stall-budget
+OneHundredMs fail:stall-budget
+OnePassword fail:stall-budget
+Onepagecrm fail:stall-budget
+Onfleet fail:stall-budget
+OpenAI fail:stall-budget
+OpenAIAds fail:stall-budget
+OpenAQ fail:stall-budget
OpenExchangeRates fail:rate-limit-budget,stall-budget
-OpenFDA fail:rate-limit-budget,stall-budget
+OpenFDA fail:stall-budget
OpenMeteo not-checkable:no-request
OpenRouter fail:rate-limit-budget,stall-budget
OpenWeather not-checkable:no-request
-Openalex fail:rate-limit-budget,stall-budget
-Opencorporates fail:rate-limit-budget,stall-budget
-OpinionStage fail:rate-limit-budget,stall-budget
-OpnPayments fail:rate-limit-budget,stall-budget
-Opsgenie fail:rate-limit-budget,stall-budget
-Optimizely fail:rate-limit-budget,safe-point,stall-budget
-Orb fail:rate-limit-budget,stall-budget
-OrcaSecurity fail:rate-limit-budget,stall-budget
+Openalex fail:stall-budget
+Opencorporates fail:stall-budget
+OpinionStage fail:stall-budget
+OpnPayments fail:stall-budget
+Opsgenie fail:stall-budget
+Optimizely fail:safe-point,stall-budget
+Orb fail:stall-budget
+OrcaSecurity fail:stall-budget
Ortto fail:safe-point,stall-budget
-Oura fail:rate-limit-budget,stall-budget
-Ownerrez fail:rate-limit-budget,stall-budget
+Oura fail:stall-budget
+Ownerrez fail:stall-budget
PabblySubscriptionsBilling fail:rate-limit-budget,safe-point,stall-budget
Packagist fail:rate-limit-budget,stall-budget
-Paddle fail:rate-limit-budget,stall-budget
-PagerDuty fail:rate-limit-budget,stall-budget
-PandaDoc fail:rate-limit-budget,stall-budget
-Paperform fail:rate-limit-budget,stall-budget
-Papersign fail:rate-limit-budget,stall-budget
+Paddle fail:stall-budget
+PagerDuty fail:stall-budget
+PandaDoc fail:stall-budget
+Paperform fail:stall-budget
+Papersign fail:stall-budget
Pardot not-checkable:database
-PartnerStack fail:rate-limit-budget,stall-budget
-Partnerize fail:rate-limit-budget,stall-budget
+PartnerStack fail:stall-budget
+Partnerize fail:stall-budget
PayFit fail:stall-budget
-Paymongo fail:rate-limit-budget,stall-budget
-Paystack fail:rate-limit-budget,stall-budget
-PeecAI fail:rate-limit-budget,stall-budget
+Paystack fail:stall-budget
Pendo fail:rate-limit-budget,stall-budget
-Perigon fail:rate-limit-budget,stall-budget
-PersistIq fail:rate-limit-budget,stall-budget
+Perigon fail:stall-budget
+PersistIq fail:stall-budget
Persona fail:rate-limit-budget,stall-budget
-Personio fail:rate-limit-budget,stall-budget
-Pexels fail:rate-limit-budget,stall-budget
-Phyllo fail:rate-limit-budget,stall-budget
-Picqer fail:rate-limit-budget,stall-budget
-Pinecone fail:rate-limit-budget,stall-budget
-Pingdom fail:rate-limit-budget,stall-budget
+Personio fail:stall-budget
+Pexels fail:stall-budget
+Phyllo fail:stall-budget
+Picqer fail:stall-budget
+Pinecone fail:stall-budget
+Pingdom fail:stall-budget
PinterestAds not-checkable:database
Pipedrive not-checkable:database
-Pipeliner fail:rate-limit-budget,safe-point,stall-budget
+Pipeliner fail:safe-point,stall-budget
Plaid fail:stall-budget
PlanetScaleMySQL not-checkable:driver:psycopg
PlanetScalePostgres not-checkable:driver:psycopg
-Planhat fail:rate-limit-budget,stall-budget
+Planhat fail:stall-budget
PlatformSh fail:rate-limit-budget,stall-budget
-Plausible fail:rate-limit-budget,stall-budget
-Plivo fail:rate-limit-budget,stall-budget
-Plunk fail:rate-limit-budget,safe-point,stall-budget
-PluralsightFlow fail:rate-limit-budget,stall-budget
+Plausible fail:stall-budget
+Plivo fail:stall-budget
+Plunk fail:safe-point,stall-budget
+PluralsightFlow fail:stall-budget
Polar fail:rate-limit-budget,stall-budget
-Polymarket fail:rate-limit-budget,stall-budget
-Poplar fail:rate-limit-budget,stall-budget
+Polymarket fail:stall-budget
Postgres not-checkable:driver:psycopg
-Postmark fail:rate-limit-budget,stall-budget
-Postscript fail:rate-limit-budget,stall-budget
+Postmark fail:stall-budget
+Postscript fail:stall-budget
PowerBiAdmin fail:rate-limit-budget,safe-point,stall-budget
-PrefectCloud fail:rate-limit-budget,stall-budget
-Pretix fail:rate-limit-budget,stall-budget
+PrefectCloud fail:stall-budget
+Pretix fail:stall-budget
Printify fail:rate-limit-budget,stall-budget
-Productboard fail:rate-limit-budget,stall-budget
-Productive fail:rate-limit-budget,stall-budget
-Profound fail:rate-limit-budget,stall-budget
-PromptWatch fail:rate-limit-budget
-PromptingCompany fail:rate-limit-budget,stall-budget
+Productboard fail:stall-budget
+Productive fail:stall-budget
ProofpointTap not-checkable:no-request
-Propertyware fail:rate-limit-budget,stall-budget
+Propertyware fail:stall-budget
PulumiCloud fail:rate-limit-budget,stall-budget
PyPI fail:rate-limit-budget,stall-budget
Pylon fail:rate-limit-budget,safe-point,stall-budget
-Qdrant fail:rate-limit-budget,stall-budget
-Qonto fail:rate-limit-budget,stall-budget
-Qualaroo fail:rate-limit-budget,stall-budget
+Qualaroo fail:stall-budget
Qualtrics fail:rate-limit-budget
QualysVmdr fail:rate-limit-budget,stall-budget
-Quo fail:rate-limit-budget,stall-budget
+Quo fail:stall-budget
RKICovid fail:rate-limit-budget
Railway fail:stall-budget
-Ramp fail:rate-limit-budget,stall-budget
-Rapid7Insightvm fail:rate-limit-budget,stall-budget
-Raygun fail:rate-limit-budget,stall-budget
-Razorpay fail:rate-limit-budget,stall-budget
-RecallAI fail:rate-limit-budget,stall-budget
-Recharge fail:rate-limit-budget,stall-budget
-Recreation fail:rate-limit-budget,stall-budget
-Recruitee fail:rate-limit-budget,stall-budget
-Recurly fail:rate-limit-budget,stall-budget
+Ramp fail:stall-budget
+Rapid7Insightvm fail:stall-budget
+Raygun fail:stall-budget
+Razorpay fail:stall-budget
+RecallAI fail:stall-budget
+Recharge fail:stall-budget
+Recreation fail:stall-budget
+Recruitee fail:stall-budget
+Recurly fail:stall-budget
RedditAds not-checkable:database
Redshift not-checkable:driver:psycopg
-ReferralHero fail:rate-limit-budget,stall-budget
+ReferralHero fail:stall-budget
Render fail:rate-limit-budget,stall-budget
-RentCast fail:rate-limit-budget,stall-budget
+RentCast fail:stall-budget
Replicate fail:rate-limit-budget,safe-point,stall-budget
-ReplyIo fail:rate-limit-budget,stall-budget
-Resend fail:rate-limit-budget,stall-budget
-RetellAI fail:rate-limit-budget,stall-budget
-Retently fail:rate-limit-budget,stall-budget
-RevenueCat fail:rate-limit-budget,safe-point,stall-budget
-Reverb fail:rate-limit-budget,stall-budget
-RevolutMerchant fail:rate-limit-budget,stall-budget
-Rippling fail:rate-limit-budget,stall-budget
-Roark fail:rate-limit-budget,stall-budget
-Rocketlane fail:rate-limit-budget,stall-budget
+ReplyIo fail:stall-budget
+Resend fail:stall-budget
+RetellAI fail:stall-budget
+Retently fail:stall-budget
+RevenueCat fail:safe-point,stall-budget
+Reverb fail:stall-budget
+Rippling fail:stall-budget
+Roark fail:stall-budget
+Rocketlane fail:stall-budget
RoktAds fail:rate-limit-budget,stall-budget
Rollbar fail:rate-limit-budget,stall-budget
-Rootly fail:rate-limit-budget,stall-budget
-Rss fail:rate-limit-budget,stall-budget
+Rootly fail:stall-budget
+Rss fail:stall-budget
Rubygems fail:rate-limit-budget,stall-budget
-Ruddr fail:rate-limit-budget,stall-budget
+Ruddr fail:stall-budget
RunPod fail:rate-limit-budget,safe-point,stall-budget
SFTP not-checkable:transport
-SafetyCulture fail:rate-limit-budget,stall-budget
+SafetyCulture fail:stall-budget
SageHR fail:rate-limit-budget,safe-point,stall-budget
-SalesLoft fail:rate-limit-budget,stall-budget
-Salesflare fail:rate-limit-budget,stall-budget
+SalesLoft fail:stall-budget
+Salesflare fail:stall-budget
Salesforce not-checkable:database
-SavvyCal fail:rate-limit-budget,stall-budget
-ScaleAI fail:rate-limit-budget,stall-budget
+SavvyCal fail:stall-budget
+ScaleAI fail:stall-budget
Scaleway fail:rate-limit-budget,safe-point
-Scalr fail:rate-limit-budget,stall-budget
-Scrunch fail:rate-limit-budget,stall-budget
-Secoda fail:rate-limit-budget,stall-budget
-Secureframe fail:rate-limit-budget,stall-budget
+Scrunch fail:stall-budget
+Secoda fail:stall-budget
+Secureframe fail:stall-budget
Segment fail:rate-limit-budget,stall-budget
-SelectStar fail:rate-limit-budget,stall-budget
-SemanticScholar fail:rate-limit-budget,stall-budget
-Semaphore fail:rate-limit-budget,stall-budget
-Semgrep fail:rate-limit-budget,stall-budget
-Semrush fail:rate-limit-budget,stall-budget
-SendGrid fail:rate-limit-budget,stall-budget
-Sendowl fail:rate-limit-budget,stall-budget
-Sentinelone fail:rate-limit-budget,stall-budget
-Sentry fail:rate-limit-budget,stall-budget
-Sequenzy fail:rate-limit-budget,stall-budget
-Serpstat fail:rate-limit-budget,stall-budget
-ServiceNow fail:rate-limit-budget,stall-budget
-Servicem8 fail:rate-limit-budget,stall-budget
-Sevdesk fail:rate-limit-budget,safe-point,stall-budget
-SevenShifts fail:rate-limit-budget,stall-budget
+SelectStar fail:stall-budget
+SemanticScholar fail:stall-budget
+Semaphore fail:stall-budget
+Semgrep fail:stall-budget
+SendGrid fail:stall-budget
+Sendowl fail:stall-budget
+Sentinelone fail:stall-budget
+Sentry fail:stall-budget
+Sequenzy fail:stall-budget
+Serpstat fail:stall-budget
+ServiceNow fail:stall-budget
+Servicem8 fail:stall-budget
+Sevdesk fail:safe-point,stall-budget
SharePoint fail:rate-limit-budget,stall-budget
-ShipStation fail:rate-limit-budget,stall-budget
-Shipmail fail:rate-limit-budget,stall-budget
+ShipStation fail:stall-budget
Shippo fail:rate-limit-budget,safe-point,stall-budget
-ShopWired fail:rate-limit-budget,stall-budget
+ShopWired fail:stall-budget
Shopify fail:stall-budget
-Shortcut fail:rate-limit-budget,stall-budget
-Shortio fail:rate-limit-budget,stall-budget
-Shutterstock fail:rate-limit-budget,stall-budget
+Shortcut fail:stall-budget
+Shortio fail:stall-budget
+Shutterstock fail:stall-budget
SigNoz fail:stall-budget
-SigmaComputing fail:rate-limit-budget,stall-budget
-Sim fail:rate-limit-budget,stall-budget
+SigmaComputing fail:stall-budget
+Sim fail:stall-budget
SimFin fail:rate-limit-budget
Similarweb fail:rate-limit-budget
-SimpleCast fail:rate-limit-budget,stall-budget
-Simplesat fail:rate-limit-budget,stall-budget
-Singlestore fail:rate-limit-budget,stall-budget
+SimpleCast fail:stall-budget
+Simplesat fail:stall-budget
+Singlestore fail:stall-budget
Singular fail:stall-budget
-Skyvern fail:rate-limit-budget,stall-budget
+Skyvern fail:stall-budget
Slack not-checkable:schemas
-Slash fail:rate-limit-budget,stall-budget
-Sleekplan fail:rate-limit-budget,stall-budget
+Slash fail:stall-budget
Smaily fail:rate-limit-budget,safe-point,stall-budget
-SmartEngage fail:rate-limit-budget,stall-budget
-Smartlead fail:rate-limit-budget,stall-budget
-Smartreach fail:rate-limit-budget,stall-budget
-Smartsheet fail:rate-limit-budget,stall-budget
-Smartwaiver fail:rate-limit-budget,stall-budget
+SmartEngage fail:stall-budget
+Smartlead fail:stall-budget
+Smartreach fail:stall-budget
+Smartsheet fail:stall-budget
+Smartwaiver fail:stall-budget
SnapchatAds not-checkable:database
Snowflake not-checkable:driver:snowflake
Snowplow fail:rate-limit-budget,stall-budget
-Snyk fail:rate-limit-budget,stall-budget
-SodaCloud fail:rate-limit-budget,stall-budget
-SolarwindsServiceDesk fail:rate-limit-budget,stall-budget
-SonarCloud fail:rate-limit-budget,stall-budget
+Snyk fail:stall-budget
+SodaCloud fail:stall-budget
+SolarwindsServiceDesk fail:stall-budget
+SonarCloud fail:stall-budget
Sonarqube fail:rate-limit-budget,stall-budget
SonatypeNexus fail:rate-limit-budget,stall-budget
Sourcegraph fail:stall-budget
Spacelift fail:stall-budget
-SparkPost fail:rate-limit-budget,stall-budget
-Speedcurve fail:rate-limit-budget,stall-budget
+SparkPost fail:stall-budget
+Speedcurve fail:stall-budget
SplitIo fail:rate-limit-budget,stall-budget
SplunkObservabilityCloud fail:rate-limit-budget,stall-budget
-SpotIo fail:rate-limit-budget,stall-budget
-SpotlerCRM fail:rate-limit-budget,stall-budget
-Sprig fail:rate-limit-budget,stall-budget
+SpotIo fail:stall-budget
+SpotlerCRM fail:stall-budget
+Sprig fail:stall-budget
Squadcast fail:rate-limit-budget,stall-budget
Square fail:rate-limit-budget,safe-point,stall-budget
Squarespace fail:rate-limit-budget,stall-budget
-StackOverflowForTeams fail:rate-limit-budget,stall-budget
+StackOverflowForTeams fail:stall-budget
Statuscake fail:rate-limit-budget,stall-budget
-Statuspage fail:rate-limit-budget,stall-budget
-Stigg fail:rate-limit-budget,stall-budget
-StockData fail:rate-limit-budget,stall-budget
-Strato fail:rate-limit-budget,stall-budget
+Statuspage fail:stall-budget
+Stigg fail:stall-budget
+StockData fail:stall-budget
StreamElements fail:rate-limit-budget
Stripe not-checkable:database
Stytch fail:stall-budget
SumoLogic fail:safe-point,stall-budget
Supabase not-checkable:driver:psycopg
-SurveyMonkey fail:rate-limit-budget,stall-budget
-SurveySparrow fail:rate-limit-budget,stall-budget
-Survicate fail:rate-limit-budget,stall-budget
-Svix fail:rate-limit-budget,stall-budget
+SurveyMonkey fail:stall-budget
+SurveySparrow fail:stall-budget
+Svix fail:stall-budget
Swarmia fail:rate-limit-budget,safe-point,stall-budget
-Synthesia fail:rate-limit-budget,stall-budget
-Systeme fail:rate-limit-budget,stall-budget
-TMDb fail:rate-limit-budget,stall-budget
-TVMaze fail:rate-limit-budget,stall-budget
+Synthesia fail:stall-budget
+TMDb fail:stall-budget
+TVMaze fail:stall-budget
Taboola fail:rate-limit-budget,stall-budget
Tailscale fail:rate-limit-budget,safe-point,stall-budget
-Tally fail:rate-limit-budget,stall-budget
-Tavus fail:rate-limit-budget,stall-budget
+Tally fail:stall-budget
+Tavus fail:stall-budget
TawkTo fail:stall-budget
-Teachable fail:rate-limit-budget,stall-budget
+Teachable fail:stall-budget
Teamcity fail:rate-limit-budget,stall-budget
-Teamtailor fail:rate-limit-budget,stall-budget
-TeamupFitness fail:rate-limit-budget,stall-budget
-Teamwork fail:rate-limit-budget,stall-budget
-Telli fail:rate-limit-budget,stall-budget
-Telnyx fail:rate-limit-budget,stall-budget
-Tempo fail:rate-limit-budget,stall-budget
+Teamtailor fail:stall-budget
+TeamupFitness fail:stall-budget
+Teamwork fail:stall-budget
+Telli fail:stall-budget
+Telnyx fail:stall-budget
+Tempo fail:stall-budget
TemporalIO not-checkable:driver:temporalio.client
TenableVulnerabilityManagement fail:stall-budget
-Tenjin fail:rate-limit-budget,stall-budget
+Tenjin fail:stall-budget
TerraformCloud fail:rate-limit-budget,safe-point,stall-budget
Testrail fail:rate-limit-budget,stall-budget
-Thinkific fail:rate-limit-budget,stall-budget
-ThinkificCourses fail:rate-limit-budget,stall-budget
-Thousandeyes fail:rate-limit-budget,stall-budget
-TicketTailor fail:rate-limit-budget,stall-budget
-Ticketmaster fail:rate-limit-budget,stall-budget
+Thinkific fail:stall-budget
+ThinkificCourses fail:stall-budget
+Thousandeyes fail:stall-budget
+TicketTailor fail:stall-budget
TikTokAds not-checkable:database
-Tinyemail fail:rate-limit-budget,stall-budget
-Todoist fail:rate-limit-budget,stall-budget
-TogetherAI fail:rate-limit-budget,stall-budget
-Torii fail:rate-limit-budget,stall-budget
+Tinyemail fail:stall-budget
+Todoist fail:stall-budget
+TogetherAI fail:stall-budget
+Torii fail:stall-budget
Transistor fail:rate-limit-budget,stall-budget
TravisCI fail:rate-limit-budget,stall-budget
-Trello fail:rate-limit-budget,stall-budget
-Tremendous fail:rate-limit-budget,stall-budget
+Trello fail:stall-budget
+Tremendous fail:stall-budget
TriggerDev fail:rate-limit-budget,stall-budget
Trino not-checkable:schemas
-TrunkIo fail:rate-limit-budget,safe-point,stall-budget
+TrunkIo fail:safe-point,stall-budget
TrustPilot fail:rate-limit-budget
-Trustradius fail:rate-limit-budget,stall-budget
-Turso fail:rate-limit-budget,stall-budget
+Trustradius fail:stall-budget
+Turso fail:stall-budget
TwelveData fail:rate-limit-budget
-TwelveLabs fail:rate-limit-budget,stall-budget
-Twenty fail:rate-limit-budget,stall-budget
-Twilio fail:rate-limit-budget,stall-budget
-Twitter fail:rate-limit-budget,stall-budget
+TwelveLabs fail:stall-budget
+Twenty fail:stall-budget
+Twilio fail:stall-budget
TwitterAds not-checkable:database
-TyntecSMS fail:rate-limit-budget,stall-budget
-Typeform fail:rate-limit-budget,stall-budget
+TyntecSMS fail:stall-budget
+Typeform fail:stall-budget
USCensus fail:rate-limit-budget,stall-budget
Ubidots fail:rate-limit-budget,safe-point,stall-budget
-UkCompaniesHouse fail:rate-limit-budget,stall-budget
-Unleash fail:rate-limit-budget,safe-point,stall-budget
+UkCompaniesHouse fail:stall-budget
+Unleash fail:safe-point,stall-budget
Unstructured fail:rate-limit-budget,stall-budget
UpPromote not-checkable:database
-Upstash fail:rate-limit-budget,stall-budget
+Upstash fail:stall-budget
Uptimerobot fail:stall-budget
UsBea fail:rate-limit-budget,stall-budget
-UsEia fail:rate-limit-budget,stall-budget
-UsTreasuryFiscalData fail:rate-limit-budget,stall-budget
+UsEia fail:stall-budget
+UsTreasuryFiscalData fail:stall-budget
Usersnap fail:rate-limit-budget,stall-budget
-Uservoice fail:rate-limit-budget,stall-budget
-Vantage fail:rate-limit-budget,stall-budget
+Uservoice fail:stall-budget
+Vantage fail:stall-budget
Vapi fail:rate-limit-budget,stall-budget
-Veeqo fail:rate-limit-budget,stall-budget
-Vellum fail:rate-limit-budget,stall-budget
-Vendr fail:rate-limit-budget,stall-budget
+Veeqo fail:stall-budget
+Vellum fail:stall-budget
+Vendr fail:stall-budget
Veracode fail:stall-budget
Vercel fail:rate-limit-budget,stall-budget
-Vimeo fail:rate-limit-budget,stall-budget
-Vitally fail:rate-limit-budget,safe-point,stall-budget
-Vultr fail:rate-limit-budget,stall-budget
-Wasabi fail:rate-limit-budget,stall-budget
-Watchmode fail:rate-limit-budget,stall-budget
-Waydev fail:rate-limit-budget,stall-budget
-Webflow fail:rate-limit-budget,stall-budget
+Vitally fail:safe-point,stall-budget
+Vultr fail:stall-budget
+Wasabi fail:stall-budget
+Watchmode fail:stall-budget
+Waydev fail:stall-budget
+Webflow fail:stall-budget
WeightsAndBiases fail:stall-budget
-WhoGho fail:rate-limit-budget,stall-budget
-Whop fail:rate-limit-budget,stall-budget
+WhoGho fail:stall-budget
+Whop fail:stall-budget
WikipediaPageviews fail:rate-limit-budget,safe-point
-Windmill fail:rate-limit-budget,stall-budget
-WooCommerce fail:rate-limit-budget,stall-budget
+Windmill fail:stall-budget
+WooCommerce fail:stall-budget
Wordpress fail:rate-limit-budget,stall-budget
WorkOS not-checkable:database
-Workable fail:rate-limit-budget,stall-budget
-Workday fail:rate-limit-budget,stall-budget
-Workiz fail:rate-limit-budget,stall-budget
-WorldBank fail:rate-limit-budget,stall-budget
+Workable fail:stall-budget
+Workday fail:stall-budget
+Workiz fail:stall-budget
+WorldBank fail:stall-budget
Wrike not-checkable:no-request
Writesonic fail:rate-limit-budget,safe-point,stall-budget
-Wufoo fail:rate-limit-budget,stall-budget
-Xendit fail:rate-limit-budget,stall-budget
-Xmatters fail:rate-limit-budget,stall-budget
-Xsolla fail:rate-limit-budget,stall-budget
-Ynab fail:rate-limit-budget,stall-budget
-Yoco fail:rate-limit-budget,stall-budget
-YouSign fail:rate-limit-budget,stall-budget
+Wufoo fail:stall-budget
+Xendit fail:stall-budget
+Xmatters fail:stall-budget
+Xsolla fail:stall-budget
+Ynab fail:stall-budget
+YouSign fail:stall-budget
YouTubeAnalytics not-checkable:database
-ZapSign fail:rate-limit-budget,safe-point,stall-budget
+ZapSign fail:safe-point,stall-budget
ZapierSupportedStorage fail:rate-limit-budget,safe-point,stall-budget
-Zendesk fail:rate-limit-budget,stall-budget
-ZendeskSell fail:rate-limit-budget,stall-budget
-ZendeskSunshine fail:rate-limit-budget,stall-budget
+Zendesk fail:stall-budget
+ZendeskSell fail:stall-budget
+ZendeskSunshine fail:stall-budget
Zenduty fail:rate-limit-budget,safe-point,stall-budget
-Zenloop fail:rate-limit-budget,stall-budget
+Zenloop fail:stall-budget
Zep fail:rate-limit-budget,stall-budget
Zero fail:rate-limit-budget
ZohoCRM fail:rate-limit-budget
-ZonkaFeedback fail:rate-limit-budget,stall-budget
-Zoom fail:rate-limit-budget,stall-budget
-Zuora fail:rate-limit-budget,stall-budget
-Zylo fail:rate-limit-budget,stall-budget
-shared-path:rest-client-paginate fail:rate-limit-budget,safe-point,stall-budget
-shared-path:rest-framework-resource fail:rate-limit-budget,stall-budget
-shared-path:rest-framework-resource-with-timeout fail:rate-limit-budget,stall-budget
-shared-path:rest-framework-wrapped-resource fail:rate-limit-budget,safe-point,stall-budget
+ZonkaFeedback fail:stall-budget
+Zoom fail:stall-budget
+Zuora fail:stall-budget
+Zylo fail:stall-budget
+shared-path:rest-client-paginate fail:safe-point,stall-budget
+shared-path:rest-framework-resource fail:stall-budget
+shared-path:rest-framework-resource-with-timeout fail:stall-budget
+shared-path:rest-framework-wrapped-resource fail:safe-point,stall-budget
shared-path:tracked-session fail:rate-limit-budget
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/twitter/twitter.py b/products/warehouse_sources/backend/temporal/data_imports/sources/twitter/twitter.py
index e2a90a9b9b1f..eb742e547014 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/twitter/twitter.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/twitter/twitter.py
@@ -36,6 +36,13 @@ _USERNAME_RE = re.compile(r"^[A-Za-z0-9_]{1,15}$")
_REQUEST_TIMEOUT = 30
+# X rate limit windows are 15 minutes wide, and a 429 names the end of the window. The shared
+# client fails a request that is asked to wait longer than its default limit, so both limits are
+# raised here to let one request wait a whole window out.
+_RATE_LIMIT_WINDOW_SECONDS = 15 * 60
+_RETRY_AFTER_MAX_SECONDS = _RATE_LIMIT_WINDOW_SECONDS + 60
+_RETRY_BUDGET_SECONDS = _RETRY_AFTER_MAX_SECONDS + 60
+
# Smallest `max_results` every paged endpoint accepts: the post timelines require at least 5, the
# user and list endpoints at least 1. Used for the permission probes, which only need the status.
_PROBE_PAGE_SIZE = 5
@@ -251,6 +258,8 @@ def _iter_pages(
"allowed_hosts": [],
"allow_redirects": False,
"request_timeout": _REQUEST_TIMEOUT,
+ "retry_after_max_seconds": _RETRY_AFTER_MAX_SECONDS,
+ "retry_budget_seconds": _RETRY_BUDGET_SECONDS,
},
"resources": [get_resource(endpoint_config, username, user_id, should_use_incremental_field)],
}