Skip to content
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

FeedRanges: Fixes GetFeedRangesAsync throwing DocumentClientException #4640

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

ealsur
Copy link
Member

@ealsur ealsur commented Aug 13, 2024

Pull Request Template

Description

Container.GetFeedRangesAsync performs a read on PartitionKeyRanges leveraging the PartititonKeyRangeCache. This translates into an HTTP operation to Gateway.

In cases where Gateway returns a failure (see linked issue), the GatewayStoreClient will fail creating a DocumentClientException.

In normal circumstances, PartitionKeyRangeCache is used within the scope of the Handler pipeline, on which any DocumentClientException is converted to CosmosException, but because this is a direct invocation, there is nothing doing the conversion and DocumentClientException ends up being thrown to the user.

Solution

The proposed solution applies the conversion at the method level (GetFeedRangesAsync) to ensure the DocumentClientException is not received by the user.

An alternative that was evaluated was to apply the conversion within the PartitionKeyRangeCache but the problem is that this component is used within other components (such as the Direct Transport stack) where there are already contracts in-place that would expect DocumentClientException. Breaking this contract would be dangerous.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Closing issues

Closes #4528

@ealsur ealsur added the auto-merge Enables automation to merge PRs label Aug 13, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot merged commit 7bc8e3c into master Aug 13, 2024
22 checks passed
@microsoft-github-policy-service microsoft-github-policy-service bot deleted the users/ealsur/aggrfeedranges branch August 13, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Enables automation to merge PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AggregateException (instead of CosmosException) being thrown on GetFeedRanges when Gateway fails
3 participants