-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[rc2] Cosmos: Use ExecutionStrategy for query execution #36671
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
Conversation
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
AndriySvyryd
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.
@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>
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.
There's currently no way to verify this, we'll have to wait for customer feedback.
Not awesome, but understood.
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.