: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(data-imports): classify DebugBear connection resets as retryable (#127278)
Tom Owers71802d479f50
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/debugbear/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/debugbear/source.pyindex 2b92f4dbffbf..12f884e45401 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/debugbear/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/debugbear/source.py@@ -61,7 +61,13 @@ class DebugbearSource(SimpleSource[DebugbearSourceConfig]):# clears rather than surfacing it as tracked exception noise. `raise_for_status` derives# these prefixes from the status code alone, not the vendor's reason text, so they're# stable to match on.- return {"Server Error", "429 Client Error"}+ #+ # `DEFAULT_RETRY`'s connect-retry budget covers a dropped or reset connection the same way —+ # a refused connection, a read timeout, or a TLS handshake reset (`SSLError`, which `requests`+ # models as a `ConnectionError`) all count against it. urllib3 wraps the exhausted failure as+ # "... Max retries exceeded with url: ..." regardless of the underlying cause, the same stable+ # prefix Close, Google Sheets, Langfuse, Notion and SigNoz match for their own bespoke sessions.+ return {"Server Error", "429 Client Error", "Max retries exceeded with url"}def get_canonical_descriptions(self) -> CanonicalDescriptions:from products.warehouse_sources.backend.temporal.data_imports.sources.debugbear.canonical_descriptions import (diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/debugbear/tests/test_debugbear_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/debugbear/tests/test_debugbear_source.pyindex 0db06b142a17..4479a02ff123 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/debugbear/tests/test_debugbear_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/debugbear/tests/test_debugbear_source.py@@ -45,6 +45,11 @@ class TestDebugbearSource:"502 Server Error: Bad Gateway for url: https://www.debugbear.com/api/v1/projects","503 Server Error: Service Unavailable for url: https://www.debugbear.com/api/v1/projects","429 Client Error: Too Many Requests for url: https://www.debugbear.com/api/v1/projects",+ # A TLS handshake reset or a refused/dropped connection exhausts the same connect-retry+ # budget and reaches us wrapped in urllib3's stable "Max retries exceeded" prefix.+ "HTTPSConnectionPool(host='www.debugbear.com', port=443): Max retries exceeded with url: "+ "/api/v1/projects (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] "+ "EOF occurred in violation of protocol (_ssl.c:1082)')))",],)def test_retryable_errors_match(self, message: str) -> None: