Skip to content

Differentiate MAX_CONCURRENCY and DEFAULT_CONCURRENCY doc comments#798

Open
demoray wants to merge 1 commit into
mainfrom
bcaswell/blob-concurrency-doc-distinction
Open

Differentiate MAX_CONCURRENCY and DEFAULT_CONCURRENCY doc comments#798
demoray wants to merge 1 commit into
mainfrom
bcaswell/blob-concurrency-doc-distinction

Conversation

@demoray
Copy link
Copy Markdown
Collaborator

@demoray demoray commented May 18, 2026

The two constants in src/upload/blobstore.rs carried identical
multi-line rationale, so the comments didn't distinguish the per-host
cap from the default that applies when the caller passes None.
Anyone bumping the default to handle a user request would have had to
notice the cap by reading code, not docs — exactly the drift the
duplication invited.

Rewrite each comment to describe what its constant actually controls:

  • MAX_CONCURRENCY is the hard cap applied after caller-supplied and
    memory-derived values. Keeps the scaleset rationale where it
    matters.
  • DEFAULT_CONCURRENCY is the value used when the caller passes
    None. References MAX_CONCURRENCY for the underlying reasoning.

silently exceed the cap if either value changes later.

Verified with:

  • cargo fmt --check
  • cargo clippy --all-features --all-targets -- -D warnings
  • cargo test --all-features

The two constants carried identical multi-line rationale, so the
comments didn't distinguish the per-host cap from the default that
applies when the caller passes `None`. Anyone bumping the default
would have to notice the cap by reading code, not docs.

Rewrite each comment to describe what its constant actually controls,
silently exceed the cap if either value changes later.
@demoray demoray enabled auto-merge (squash) May 18, 2026 20:50
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