-
Notifications
You must be signed in to change notification settings - Fork 2.2k
escapeNonAscIIPkValueForQueryPlanAndQuery #47881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
escapeNonAscIIPkValueForQueryPlanAndQuery #47881
Conversation
1d2ffaa to
dfe4bc0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for few comments
FabianMeiswinkel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Thanks!
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Utils.java
Show resolved
Hide resolved
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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