Skip to content

Commit 4c99954

Browse files
yarikopticclaude
andcommitted
BF: Set explicit timeout for zarr chunk upload PUT requests
Previously, zarr chunk uploads used no explicit timeout, relying on OS TCP defaults. For large zarr chunks (e.g., 2.6 GB level-0 OME-Zarr chunks), the upload can take many minutes at typical home upload speeds (~7 min at 50 Mbps, ~70 min at 5 Mbps). Without a timeout, the client either hangs indefinitely on network failures, or the OS TCP stack's default keepalive/idle timeout (often ~120s on Windows) kills the connection before a large upload can complete. Set an explicit requests timeout of (60, 7200) — 60 seconds for TCP connect, 2 hours for response read. The read timeout covers the period after the full request body is sent while waiting for S3's response, which is where ConnectionAbortedError was observed in #1821. Note: this does NOT limit the upload body transfer time itself. The requests library's read timeout only applies to waiting for response data, not to sending request data. So even very slow multi-hour uploads will not be interrupted by this timeout. Ref: #1821 Co-Authored-By: Claude Code 2.1.81 / Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6d2779d commit 4c99954

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

dandi/files/zarr.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,7 @@ def _upload_zarr_file(
969969
json_resp=False,
970970
retry_if=_retry_zarr_file,
971971
headers=headers,
972+
timeout=(60, 7200),
972973
)
973974
except requests.HTTPError as e:
974975
post_upload_size_check(item.filepath, item.size, True)

0 commit comments

Comments
 (0)