: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(iterable): keep exhausted 429 retries out of error tracking (#124452)
Tom Owers8805a7097945
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/iterable/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/iterable/source.pyindex fffe19a574be..eece3bdb5378 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/iterable/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/iterable/source.py@@ -87,6 +87,13 @@ class IterableSource(ResumableSource[IterableSourceConfig, IterableResumeConfig]),}+ def get_retryable_errors(self) -> set[str]:+ # `iterable.py` already retries 429s via the tracked session's RATE_LIMITED_RETRY (honoring+ # Retry-After, with the export/metrics-specific backoff) and paces export requests between+ # windows. If that budget still exhausts, Temporal retries the whole activity, so the+ # failure is self-recovering rather than a bug to page on.+ return {"429 Client Error"}+def get_schemas(self,config: IterableSourceConfig,diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/iterable/tests/test_iterable_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/iterable/tests/test_iterable_source.pyindex 9c5147513435..2370d9ef45bc 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/iterable/tests/test_iterable_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/iterable/tests/test_iterable_source.py@@ -31,3 +31,13 @@ class TestIterableSource:assert is_valid is expected_validassert error_message == expected_messagemock_validate.assert_called_once_with(self.config.api_key, self.config.region)++ def test_retryable_errors_match_rate_limit_raise(self) -> None:+ # The message `_stream_export_window` (iterable.py) re-raises once the tracked session's+ # own 429 retries exhaust.+ observed_error = (+ "429 Client Error: Too Many Requests for url: "+ "https://api.iterable.com/api/export/data.json?dataTypeName=emailSend"+ )+ retryable_errors = self.source.get_retryable_errors()+ assert any(key in observed_error for key in retryable_errors)