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(adjust): keep exhausted read-timeout errors out of error tracking (#83428)

Tom Owers11b6c7363deb
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/adjust/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/adjust/source.py
index 01e311833f5f..38f00f93b4e1 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/adjust/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/adjust/source.py
@@ -61,6 +61,13 @@ class AdjustSource(ResumableSource[AdjustSourceConfig, AdjustResumeConfig]):
"404 Client Error: Not Found for url: https://automate.adjust.com": "Adjust could not find the requested report data. Check the app tokens on this source.",
}
+ def get_retryable_errors(self) -> set[str]:
+ # The tracked session's own urllib3 retries (see common/http/transport.py) cover read
+ # timeouts and connection failures on GET, not just 429/5xx. Once that budget exhausts,
+ # requests wraps the failure as this host-scoped pool error and Temporal retries the
+ # whole activity from there, so it's transient and self-recovering rather than a bug.
+ return {"HTTPSConnectionPool(host='automate.adjust.com', port=443)"}
+
@property
def get_source_config(self) -> SourceConfig:
return SourceConfig(
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/adjust/tests/test_adjust_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/adjust/tests/test_adjust_source.py
index 99d4bb58b086..2572e256b326 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/adjust/tests/test_adjust_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/adjust/tests/test_adjust_source.py
@@ -90,6 +90,17 @@ class TestAdjustSource:
def test_throttles_and_5xx_stay_retryable(self, observed_error: str) -> None:
assert not any(key in observed_error for key in self.source.get_non_retryable_errors())
+ def test_exhausted_connection_pool_error_is_classified_retryable(self) -> None:
+ # Matches the message urllib3 raises once the tracked session's own GET retries
+ # (read timeouts, connection failures) exhaust — keeps this transient, self-recovering
+ # failure out of error tracking instead of reaching `logger.aexception`.
+ observed_error = (
+ "HTTPSConnectionPool(host='automate.adjust.com', port=443): Max retries exceeded with "
+ 'url: /reports-service/report?dimensions=day (Caused by ReadTimeoutError("HTTPSConnectionPool'
+ "(host='automate.adjust.com', port=443): Read timed out. (read timeout=300)\"))"
+ )
+ assert any(key in observed_error for key in self.source.get_retryable_errors())
+
def test_get_schemas_covers_every_report(self) -> None:
schemas = self.source.get_schemas(self.config, self.team_id)
assert {schema.name for schema in schemas} == set(ENDPOINTS)