[rc2] Cosmos: Use ExecutionStrategy for query execution#36671
Merged
AndriySvyryd merged 3 commits intorelease/10.0from Aug 27, 2025
Merged
[rc2] Cosmos: Use ExecutionStrategy for query execution#36671AndriySvyryd merged 3 commits intorelease/10.0from
AndriySvyryd merged 3 commits intorelease/10.0from
Conversation
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Cosmos: Use ExecutionStrategy for query execution
Cosmos: Use ExecutionStrategy for query execution
Aug 27, 2025
AndriySvyryd
approved these changes
Aug 27, 2025
Member
AndriySvyryd
left a comment
There was a problem hiding this comment.
@copilot Rewrite the PR summary using this template:
Fixes #{number}
**Description**
{Issue description}
**Customer impact**
{How does the reported issue affects customer's app? Are there workarounds?}
**How found**
{Was it customer reported or found during verification? How many customers are affected?}
**Regression**
{Is it a regression from a released version? Which one?}
**Testing**
{How the changes were tested}
**Risk**
{Low/Medium/High, argument why}
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Contributor
Author
artl93
approved these changes
Aug 27, 2025
roji
approved these changes
Aug 27, 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.
Fixes #35692
Description
The Cosmos provider was not using
ExecutionStrategyduring query execution, which meant that transient failures during queries would not be retried according to the configured retry policy. TheCosmosClientWrapperalready received anIExecutionStrategyinstance and used it for CRUD operations (Create, Replace, Delete, ReadItem), but it was not being used for query execution throughExecuteSqlQueryandExecuteSqlQueryAsync.Customer impact
Customers using the Cosmos provider may experience application failures during transient network issues or service unavailability when executing queries. Without ExecutionStrategy, these failures would not be automatically retried, leading to unnecessary exceptions that could have been handled transparently. There are no straightforward workarounds besides implementing custom retry logic at the application level.
How found
This was reported by a customer.
Regression
No. It's a missing part of a feature that has existed since the Cosmos provider's inception.
Testing
There's currently no way to verify this, we'll have to wait for customer feedback.
Risk
Low. The changes are minimal and surgical, only affecting the actual database call points in
DocumentEnumerableandDocumentAsyncEnumerablewhile preserving all existing enumeration behavior. TheExecutionStrategypattern is well-established in other providers.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.