[Internal] [FaultInjection] ThinClient: Fixes payload of injected errors for requests going to ThinClient Proxy#5269
Merged
FabianMeiswinkel merged 33 commits intomasterfrom Aug 13, 2025
Conversation
Member
|
Please add more detailed description on the usage. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the payload of injected errors for requests going to ThinClient Proxy to ensure diagnostics contain correct information. The error injection point is moved from CosmosHttpClientCore to ThinClientStoreClient to allow direct response return without using thin client serialization/deserialization on faulty responses.
- Moves fault injection from HTTP client layer to ThinClient store client layer
- Updates error response formatting to match proxy call expectations with proper JSON payloads
- Removes unnecessary header setting logic from HTTP client core
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ThinClientStoreClient.cs | Adds chaos interceptor integration and fault injection handling at the store client level |
| CosmosHttpClientCore.cs | Removes fault injection header setting logic that is no longer needed |
| GatewayStoreModel.cs | Passes chaos interceptor to ThinClientStoreClient constructor |
| DocumentClient.cs | Passes chaos interceptor parameter to GatewayStoreModel |
| FaultInjectionServerErrorResultInternal.cs | Updates error response formatting for proxy calls with proper JSON payloads and HTTP versions |
| FaultInjectionRuleProcessor.cs | Passes global endpoint manager to fault injection server error result |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ananth7592
approved these changes
Aug 13, 2025
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.
Pull Request Template
Description
This fixes the payload of injected errors for requests going to the thin client to ensure that diagnostics contain the correct information.
This PR, move the injection point of the error from the
CosmosHttpClientCoreto theThinClientStoreClient. This allows for a direct return of the response without the need to use the thin client serialization/deserialization on the faulty response generation/return.To enable fault injection for thin client mode, create a fault injection rule the same way you would for any other gateway mode fault injection rule. Then, enable thin client mode for the client via the enable thin client environment variable.
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #5342