escapeNonAscIIPkValueForQueryPlanAndQuery#47881
Open
xinlian12 wants to merge 9 commits intoAzure:mainfrom
Open
escapeNonAscIIPkValueForQueryPlanAndQuery#47881xinlian12 wants to merge 9 commits intoAzure:mainfrom
xinlian12 wants to merge 9 commits intoAzure:mainfrom
Conversation
1d2ffaa to
dfe4bc0
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request has a critical discrepancy between its stated purpose and actual implementation. The PR claims to fix escaping of non-ASCII characters in partition key values for query plans to prevent 400 Bad Request errors, but contains completely unrelated changes.
Changes:
- Modified clientMap usage from
getOrDefaulttocomputein RxDocumentClientImpl.java (contains a bug) - Improved test cleanup in CosmosDiagnosticsTest.java by using
safeCloseSyncClientmethod consistently
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java | Changed clientMap update logic from getOrDefault to compute method (but with incorrect postfix increment) |
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/CosmosDiagnosticsTest.java | Refactored test cleanup to use safeCloseSyncClient utility method for both test clients |
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
Outdated
Show resolved
Hide resolved
...s/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextBase.java
Outdated
Show resolved
Hide resolved
FabianMeiswinkel
requested changes
Feb 3, 2026
Member
FabianMeiswinkel
left a comment
There was a problem hiding this comment.
LGTM except for few comments
mbhaskar
reviewed
Feb 4, 2026
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Utils.java
Show resolved
Hide resolved
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.
Issue
Root cause
When pkValue is configured in the CosmosQueryRequestOptions, it is being passed as one of the http request headers, same for pre-trigger and post-trigger, and for service Kestrel closes the connection when it sees non-ASCII characters in HTTP headers.
Fixes