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(data-imports): retry transient read timeouts copying query files (#114840)

Tom Owers78edf014e623
diff --git a/products/warehouse_sources/backend/temporal/data_imports/pipelines/core/delta/errors.py b/products/warehouse_sources/backend/temporal/data_imports/pipelines/core/delta/errors.py
index 5b1d0bd68b06..692dd15853b4 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/pipelines/core/delta/errors.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/pipelines/core/delta/errors.py
@@ -78,6 +78,14 @@ def is_transient_object_store_error(error: BaseException) -> bool:
subclass, so the message-matched branch below never sees it; recognized by type for the same
reason as `NoCredentialsError`.
+ A read that times out or a connection the object store drops mid-response surfaces as a bare
+ `botocore.exceptions.HTTPClientError` (`ReadTimeoutError`, `ConnectionClosedError`) the same way:
+ s3fs's own retries only translate a *response* it got back into an `OSError`, and a request that
+ never got one never does. `s3/writer.py`'s `_is_transient_s3_write_error` already retries this
+ class on the write path; recognized by type here too so the copy/maintenance paths that share
+ this classifier treat the same blip the same way instead of reporting it as a bug on the first
+ occurrence.
+
A bare `OSError` with errno `EMFILE`/`ENFILE` means this worker's (or the system's) file
descriptor table is full — e.g. `aget_s3_client`'s aiobotocore session bootstrap opening
botocore's own bundled `endpoints.json` fails with this errno before any network call is even
@@ -101,7 +109,11 @@ def is_transient_object_store_error(error: BaseException) -> bool:
failure is a silent no-op either way) folds it in.
"""
if isinstance(
- error, TransientObjectStoreError | botocore.exceptions.NoCredentialsError | botocore.exceptions.ConnectionError
+ error,
+ TransientObjectStoreError
+ | botocore.exceptions.NoCredentialsError
+ | botocore.exceptions.ConnectionError
+ | botocore.exceptions.HTTPClientError,
):
# Already classified and wrapped by a prior call to this same function (see
# `_capture_unless_transient`) — a caller further up the stack that catches broadly and
diff --git a/products/warehouse_sources/backend/temporal/data_imports/pipelines/core/delta/test/test_delta_errors.py b/products/warehouse_sources/backend/temporal/data_imports/pipelines/core/delta/test/test_delta_errors.py
index 13abd575b0c0..9bdec8d23582 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/pipelines/core/delta/test/test_delta_errors.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/pipelines/core/delta/test/test_delta_errors.py
@@ -59,6 +59,15 @@ class TestIsTransientObjectStoreError:
botocore.exceptions.EndpointConnectionError(endpoint_url="http://objectstorage:19000/data-warehouse"),
True,
),
+ (
+ # A read timeout never gets s3fs's OSError translation (there's no response to
+ # translate), so it reaches here as the raw botocore `HTTPClientError` subclass once
+ # s3fs's own retries are exhausted - the same blip `s3/writer.py` already retries on
+ # the write path.
+ "bare_read_timeout_error",
+ botocore.exceptions.ReadTimeoutError(endpoint_url="https://example.com/part-0000.parquet"),
+ True,
+ ),
(
# aiobotocore's session bootstrap (e.g. inside `aget_s3_client`) opens botocore's own
# bundled endpoints.json before any network call is made - a full fd table fails that