Skip to content

Bound S3 request concurrency during fetch - #46

Draft
samestep wants to merge 1 commit into
mainfrom
fix-fetch-connect-timeout
Draft

Bound S3 request concurrency during fetch#46
samestep wants to merge 1 commit into
mainfrom
fix-fetch-connect-timeout

Conversation

@samestep

Copy link
Copy Markdown
Owner

Fixes #45.

`npc fetch` fanned out over every branch and release at once via
`try_join_all`, firing well over a hundred simultaneous requests at S3.
On slower-to-connect hosts (reproducible on macOS, ~17% of runs) that
thundering herd of concurrent TLS handshakes intermittently tripped the
AWS SDK's default 3.1s connect timeout, and the correlated burst of
timeouts also drained the standard retry quota so retries stopped
helping. It then succeeded on immediate retry because the connections
were warm.

Cap in-flight S3 requests with a semaphore (16) so we never open that
many connections at once, and raise the connect timeout (15s) and retry
attempts (6) as defense-in-depth. In a paired 100-iteration trial on
macOS the unfixed binary failed 17 times while this build failed 0.

Fixes #45

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JyJdJRVvqnj4Lcsk2XYECe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error during "fetching channels" in npc fetch

1 participant