Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 27, 2025

Fixes #35692

Description
The Cosmos provider was not using ExecutionStrategy during query execution, which meant that transient failures during queries would not be retried according to the configured retry policy. The CosmosClientWrapper already received an IExecutionStrategy instance and used it for CRUD operations (Create, Replace, Delete, ReadItem), but it was not being used for query execution through ExecuteSqlQuery and ExecuteSqlQueryAsync.

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 DocumentEnumerable and DocumentAsyncEnumerable while preserving all existing enumeration behavior. The ExecutionStrategy pattern 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.

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
Copilot AI requested a review from AndriySvyryd August 27, 2025 01:50
Copy link
Member

@AndriySvyryd AndriySvyryd left a 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>
Copy link
Contributor Author

Copilot AI commented Aug 27, 2025

@copilot Rewrite the PR summary using this template:

...

Updated the PR description using the requested template in commit bdbfbbd.

Copilot AI requested a review from AndriySvyryd August 27, 2025 02:20
@AndriySvyryd AndriySvyryd changed the title Cosmos: Use ExecutionStrategy for query execution [rc2] Cosmos: Use ExecutionStrategy for query execution Aug 27, 2025
@AndriySvyryd AndriySvyryd requested a review from artl93 August 27, 2025 02:23
@AndriySvyryd AndriySvyryd marked this pull request as ready for review August 27, 2025 02:24
@AndriySvyryd AndriySvyryd requested a review from a team as a code owner August 27, 2025 02:24
Copy link
Member

@artl93 artl93 left a 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.

@AndriySvyryd AndriySvyryd enabled auto-merge (squash) August 27, 2025 17:16
@AndriySvyryd AndriySvyryd merged commit 65a7167 into release/10.0 Aug 27, 2025
7 checks passed
@AndriySvyryd AndriySvyryd deleted the copilot/fix-35692 branch August 27, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cosmos: Use ExecutionStrategy for query execution

4 participants