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(warehouse-sources): treat exhausted rollbar connection retries as retryable (#112283)

Tom Owers19983dc7920a
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/rollbar/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/rollbar/source.py
index 5a4d23ae40e2..d016ee6fa8d8 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/rollbar/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/rollbar/source.py
@@ -57,6 +57,16 @@ class RollbarSource(ResumableSource[RollbarSourceConfig, RollbarResumeConfig]):
"403 Client Error: Forbidden for url: https://api.rollbar.com": "Rollbar denied access. Please check that your project access token has the read scope.",
}
+ def get_retryable_errors(self) -> set[str]:
+ # `_get_session` uses `make_tracked_session`, whose `DEFAULT_RETRY` already retries a
+ # dropped connection or read timeout before `fetch`'s own tenacity retry re-raises once
+ # that budget is exhausted too. urllib3 wraps that as "... Max retries exceeded with
+ # url: ...". `fetch` also retries a 429/5xx response itself, re-raising as
+ # "Rollbar API error (retryable): ..." once that budget is exhausted. Temporal then
+ # retries the whole activity either way, so the failure is transient and
+ # self-recovering, not a bug to report.
+ return {"Max retries exceeded with url", "Rollbar API error (retryable)"}
+
@property
def get_source_config(self) -> SourceConfig:
return SourceConfig(
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/rollbar/tests/test_rollbar_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/rollbar/tests/test_rollbar_source.py
index e6d79018883b..5998915c7500 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/rollbar/tests/test_rollbar_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/rollbar/tests/test_rollbar_source.py
@@ -36,6 +36,19 @@ class TestRollbarSource:
non_retryable_errors = self.source.get_non_retryable_errors()
assert not any(key in other_vendor_error for key in non_retryable_errors)
+ @pytest.mark.parametrize(
+ "observed_error",
+ [
+ "HTTPSConnectionPool(host='api.rollbar.com', port=443): Max retries exceeded with "
+ 'url: /api/1/instances?limit=1000 (Caused by ReadTimeoutError("HTTPSConnectionPool'
+ "(host='api.rollbar.com', port=443): Read timed out. (read timeout=60)\"))",
+ "Rollbar API error (retryable): status=503, url=https://api.rollbar.com/api/1/items?page=1",
+ ],
+ )
+ def test_retryable_errors_match_exhausted_retry(self, observed_error):
+ retryable_errors = self.source.get_retryable_errors()
+ assert any(key in observed_error for key in retryable_errors)
+
def test_get_schemas(self):
schemas = self.source.get_schemas(self.config, self.team_id)