fix(cosmos): RxDocumentServiceRequest clone field copying - #50069
Open
Arnab Nandy (arnabnandy7) wants to merge 1 commit into
Open
fix(cosmos): RxDocumentServiceRequest clone field copying#50069Arnab Nandy (arnabnandy7) wants to merge 1 commit into
Arnab Nandy (arnabnandy7) wants to merge 1 commit into
Conversation
Arnab Nandy (arnabnandy7)
requested review from
a team and
Kiran Kumar Kolli (kirankumarkolli)
as code owners
August 8, 2026 14:39
Contributor
|
Thank you for your contribution Arnab Nandy (@arnabnandy7)! We will review the pull request and get back to you soon. |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 33 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a Cosmos SDK correctness issue where RxDocumentServiceRequest.clone() failed to copy several request-scoped fields, causing hedged/availability-strategy clones to lose routing, timeout, authorization, and request metadata.
Changes:
- Updated
RxDocumentServiceRequest.clone()to copy additional request-scoped fields (includingeffectivePartitionKey,properties(defensive map copy), throughput-control, barrier/collection routing flags,responseTimeout, and HTTP transport serializer state). - Removed a redundant
requestContextassignment while retaining a defensiverequestContext.clone(). - Added regression tests for request-scoped clone behavior plus a reflection-based “audit required on new fields” completeness test.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentServiceRequest.java | Expands clone() to preserve previously omitted request-scoped state needed by hedging/availability behaviors. |
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/RxDocumentServiceRequestTest.java | Adds regression coverage for copied state and a reflection-based guard to force future clone() audits when fields are added. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
Arnab Nandy (arnabnandy7)
force-pushed
the
fix/clone-missing-request-fields
branch
from
August 8, 2026 14:54
1febff8 to
bcd268a
Compare
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.
Description
Fixes #48496.
Audits
RxDocumentServiceRequest.clone()and copies request-scoped fields that were previously omitted. This prevents cloned requests used by hedging and availability strategies from losing routing, timeout, throughput-control, authorization, and request metadata.The change:
effectivePartitionKey,properties,throughputControlGroupName,responseTimeout, andentityId.propertiesmap.requestContextassignment.clone()to be audited whenever a new instance field is introduced.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines