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

FeedIterator.ReadNextAsync blocks in v3.38.0+ #4695

Open
tobywicks-cv opened this issue Sep 16, 2024 · 1 comment
Open

FeedIterator.ReadNextAsync blocks in v3.38.0+ #4695

tobywicks-cv opened this issue Sep 16, 2024 · 1 comment
Assignees
Labels
customer-reported Issue created by a customer needs-investigation

Comments

@tobywicks-cv
Copy link

tobywicks-cv commented Sep 16, 2024

Problem occurs in v3.43.0

Describe the bug
FeedIterator<>.ReadNextAsync() blocks indefinitely when existing in a .NET 4.8 web forms app (presumably running in AspNetSynchronizationContext). This issue does not occur when running in a console app.

To Reproduce

  1. Configure a CosmosDB with a container.
  2. Execute the following with updated end point details etc.
  var endpointUri = "*****";
  var primaryKey = "*****";
  var databaseId = "*****";
  var containerId = "*****";

  var cosmosClient = new CosmosClient(endpointUri, primaryKey);
  var container = cosmosClient.GetContainer(databaseId, containerId);

  var sqlQueryText = "SELECT * FROM c";
  var queryDefinition = new QueryDefinition(sqlQueryText);
  var queryResultSetIterator = container.GetItemQueryIterator<dynamic>(queryDefinition);
  
  while (queryResultSetIterator.HasMoreResults)
  {
      foreach (var item in await queryResultSetIterator.ReadNextAsync().ConfigureAwait(false))   // <- blocks here
      {
          Console.WriteLine(item);
      }
  }

Expected behavior
Call to queryResultSetIterator.ReadNextAsync does not block indefinitely and returns the data in the container.

Actual behavior
Call to queryResultSetIterator.ReadNextAsync blocks indefinitely.

Environment summary
SDK Version: Framework 4.8.1
OS Version: Windows 11

Additional context
Seems like this issue was introduced in v3.38.0. v3.37.1 does not block. So I'm using that version for the moment.

@kirankumarkolli
Copy link
Member

@NaluTripician can you please take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issue created by a customer needs-investigation
Projects
None yet
Development

No branches or pull requests

3 participants