Deadlocks occur when querying table storage many times concurrently (.NET Core 1.1.0)
See original GitHub issueI’m having trouble with some deadlocks when querying table storage many times simultaneously. This happens whether I call cloudTable.ExistsAsync() and cloudTable.ExecuteQuerySegmentedAsync().
Having downloaded the source code for 8.1.1, I can see that the root of the issue seems to be in TableOperationHttpResponseParsers.cs. The problem is that instances of ODataReader are calling the Read() method when they should be taking advantage of the available ReadAsync() method.
Are these issues going to be fixed in the 8.2.0 release? My problem could be related to https://github.com/Azure/azure-storage-net/issues/431
The scenario can be reproduced with a simple Console Application (.NET Core 1.1.0) and using the following code sample:
private const string connectionString = "...";
private const string tableName = "...";
public static void Main(string[] args)
{
Task.Run(async () =>
{
await MainAsync(args);
}).GetAwaiter().GetResult();
}
static async Task MainAsync(string[] args)
{
Console.WriteLine("Hello World!");
var cloudStorageAccount = CloudStorageAccount.Parse(connectionString);
// run the query many times simultaneously to produce the thread lock issue
await Task.WhenAll(Enumerable.Range(0, 100).Select(m =>
{
return Query(cloudStorageAccount);
}));
Console.WriteLine(string.Format("We never get here..."));
Console.ReadLine();
}
private static async Task<bool> Query(CloudStorageAccount cloudStorageAccount)
{
var cloudTableClient = cloudStorageAccount.CreateCloudTableClient();
var cloudTable = cloudTableClient.GetTableReference(tableName);
Console.WriteLine(string.Format("Exists query started"));
// threadlock occurs here when calling table.ExistsAsync() or table.ExecuteQuerySegmentedAsync()
var result = await cloudTable.ExistsAsync();
Console.WriteLine(string.Format("Exists query finished"));
return result;
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:12 (3 by maintainers)
Top Results From Across the Web
FIX: Deadlocks may occur when multiple concurrent query ...
FIX: Deadlocks may occur when multiple concurrent query notification subscriptions are fired on same objects in SQL Server 2005 or in SQL Server...
Read more >Azure Table Storage multi row query performance
So most efficient way to get number of rows with partition and row keys known is to do them all with separate async...
Read more >https://raw.githubusercontent.com/dotnet/samples/m...
When I get 3-5 days without failure I'll update this PR. ... Net [ManagedHandler] Investigate other options for concurrent connection limits and allocations ......
Read more >TIBCO Data Virtualization User Guide
Displays and lets you set the number of times a trigger can be queued simultaneously before duplicates are dropped.
Read more >Spring Boot Actuator Web API Documentation
The endpoint uses query parameters to limit the events that it returns. The following table shows the supported query parameters: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 here… any update about this issue
I’ve tried increasing the threadpool size by adding the following to the my project’s csproj:
This hasn’t made any discernible difference and still threadlocks. Am I doing this correctly?
Is there any other way I can use the azure-storage-net table library and not have it lock up on me? This is causing us a real headache on our production system and it seems ridiculous that we can’t make 100 calls to the server without it locking up.