Details
-
Bug
-
Resolution: Gone away
-
Major - P3
-
None
-
2.13.3
-
None
-
None
Description
Application Info:
Target Framework: .NET 6,
Project Type: Blazor Server Side, Microsoft.NET.Sdk.Web
Summary
Similar issue to CSHARP-3477
When I open an Async Cursor, the application hangs.
I have determined it is the opening of the cursor, if I use code like this:
using var cursor = await _collection.FindAsync(query, options, token);
|
|
|
while (await cursor.MoveNextAsync(token)) |
loopProcessor(cursor.Current);
|
If I change the call to be:
await _collection.FindAsync(query, options, token).ToList();
|
Everything works as expected.
All this code is in a repository class that lives in an internally developed library and is used across several applications. The only application that hangs is the Blazor Server Side app.
I have not been able to duplicate this issue in any other code. It happens consistently in the Blazor app always on the same line of code. Here is the code that calls the repository class:
private List<Product> GetProductData(FilterDefinition<Product> filter) |
{
|
IEnumerable<Product>? productList = null; |
IEnumerable<Product>? partialProductList = null; |
|
System.Diagnostics.Debug.WriteLine("Process Id = {0}.", System.Diagnostics.Process.GetCurrentProcess().Id); |
|
var productListTask = _productService.GetItemsFromMongoAsync(filter, new FindOptions<Product, Product>()); |
var partialProductListTask = _partialProductService.GetItemsFromMongoAsync(filter, new FindOptions<Product, Product>()); |
|
Task.WaitAll(productListTask, partialProductListTask);
|
|
if (partialProductListTask.IsCompletedSuccessfully) |
partialProductList = partialProductListTask.Result;
|
|
if (productListTask.IsCompletedSuccessfully) |
productList = productListTask.Result;
|
|
if (productList is not null && partialProductList is not null) |
return productList.Union(partialProductList).Distinct().OrderBy(a => a.Ean).ToList(); |
else if (productList is not null && partialProductList is null) |
return productList.ToList(); |
else if (productList is null && partialProductList is not null) |
return partialProductList.ToList(); |
return new List<Product>(); |
}
|
I have attached several dump files. The dump file that ends in 095844 is immediately before the call to mongo. All the other files are after the app has hung.