Skip to content

fix(client): read whole object when ParallelGet concurrency is 1#357

Merged
alecthomas merged 1 commit into
mainfrom
aat/parallel-get-single-worker-full-read
Jun 24, 2026
Merged

fix(client): read whole object when ParallelGet concurrency is 1#357
alecthomas merged 1 commit into
mainfrom
aat/parallel-get-single-worker-full-read

Conversation

@alecthomas

Copy link
Copy Markdown
Collaborator

A single worker gains nothing from chunking, so skip the ranged
discovery request entirely and read the object in one
revision-consistent request rather than serialising ranged GETs.

A single worker gains nothing from chunking, so skip the ranged
discovery request entirely and read the object in one
revision-consistent request rather than serialising ranged GETs.
@alecthomas alecthomas requested a review from a team as a code owner June 24, 2026 23:57
@alecthomas alecthomas requested review from jrobotham-square and removed request for a team June 24, 2026 23:57
@alecthomas alecthomas enabled auto-merge (squash) June 24, 2026 23:57
@alecthomas alecthomas merged commit e6b5db3 into main Jun 24, 2026
8 checks passed
@alecthomas alecthomas deleted the aat/parallel-get-single-worker-full-read branch June 24, 2026 23:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2c5fcc7d3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread client/parallel_get.go
Comment on lines +51 to +52
if concurrency == 1 {
return fullRead(ctx, c, key, dst)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor single-worker downloads for S3 caches

When cache.ParallelGet is called with an *S3 cache and concurrency == 1, this new fast path switches from serial ranged Open calls to an unrestricted full Open. For large non-ranged S3 reads, S3.Open calls parallelGetReader (internal/cache/s3.go:246), which then uses s.config.DownloadConcurrency workers (internal/cache/s3_parallel_get.go:78, default 8 in internal/cache/s3.go:47-49), so callers that set ParallelGet(..., concurrency: 1) to throttle S3 traffic can still launch multiple concurrent S3 range GETs. Keep the serial ranged path for backends whose full Open is internally parallel, or provide an explicit single-stream/full-read path that preserves the requested concurrency limit.

Useful? React with 👍 / 👎.

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.

1 participant