: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(clickhouse): stop cold-resume read timeouts reporting error tracking noise (#78689)
Tom Owers54890788e639
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/clickhouse/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/clickhouse/source.pyindex 238cf3b8a374..93a51baae28f 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/clickhouse/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/clickhouse/source.py@@ -339,6 +339,13 @@ class ClickHouseSource(SimpleSource[ClickHouseSourceConfig], SSHTunnelMixin, Val# `_get_client`'s in-process retry never sees it; Temporal's activity retry# reopens a fresh tunnel + client and resumes from the last committed cursor."Connection broken: IncompleteRead",+ # requests/urllib3 raises this when the server accepts the connection but never+ # answers within our timeout — typically ClickHouse Cloud still cold-resuming an+ # idle service past our `METADATA_QUERY_TIMEOUT_SECONDS` allowance. Not in+ # `_TRANSIENT_CONNECT_DROP_SUBSTRINGS`, so `_get_client` doesn't retry it in-process+ # (a slow-to-wake service needs real wall-clock time, not an immediate re-dial);+ # Temporal's activity retry provides that backoff and reopens a fresh connection.+ "Read timed out",}@contextmanagerdiff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/clickhouse/test_clickhouse.py b/products/warehouse_sources/backend/temporal/data_imports/sources/clickhouse/test_clickhouse.pyindex cf64a8efec0c..4e4447d1caa2 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/clickhouse/test_clickhouse.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/clickhouse/test_clickhouse.py@@ -729,6 +729,10 @@ class TestClickHouseSourceRetryableErrors:"('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))","('Connection broken: IncompleteRead(12345 bytes read, 67 more expected)', ""IncompleteRead(12345 bytes read, 67 more expected))",+ # The server accepted the connection but never answered within our timeout —+ # typically ClickHouse Cloud still cold-resuming past our allowance.+ "Error HTTPSConnectionPool(host='play.clickhouse.com', port=8443): Read timed out. "+ "(read timeout=120) executing HTTP request attempt 1 (https://play.clickhouse.com:8443)",],)def test_transient_errors_are_retryable(self, source, error_msg):