Differentiate MAX_CONCURRENCY and DEFAULT_CONCURRENCY doc comments#798
Open
demoray wants to merge 1 commit into
Open
Differentiate MAX_CONCURRENCY and DEFAULT_CONCURRENCY doc comments#798demoray wants to merge 1 commit into
demoray wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The two constants in
src/upload/blobstore.rscarried identicalmulti-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_CONCURRENCYis the hard cap applied after caller-supplied andmemory-derived values. Keeps the scaleset rationale where it
matters.
DEFAULT_CONCURRENCYis the value used when the caller passesNone. ReferencesMAX_CONCURRENCYfor the underlying reasoning.silently exceed the cap if either value changes later.
Verified with:
cargo fmt --checkcargo clippy --all-features --all-targets -- -D warningscargo test --all-features