OData / odata.net

ODataLib: Open Data Protocol - .NET Libraries and Frameworks
https://docs.microsoft.com/odata
Other
686 stars 349 forks source link

Revisit locking logic and potential race conditions in OData Client #2536

Open habbes opened 2 years ago

habbes commented 2 years ago

OData Client has some non-trivial locking logic, but is still susceptible to race conditions (see https://github.com/OData/odata.net/pull/2533). It's used a lot in servers where it has to process a lot of concurrent requests where threading issues are most likely to occur. Most services prefer to instantiate a DataServiceContext per request scope to avoid thread-safety issues, but this also has negative implications on perf and reliability (#2514, #2321). The point of this issue is to track work to improve maintainability and reliability of locking and thread-safety in OData Client.

Assemblies affected

Microsoft.OData.Client 7.x

Reproduce steps

The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.

Expected result

What would happen if there wasn't a bug.

Actual result

What is actually happening.

Additional detail

Optional, details of the root cause if known. Delete this section if you have no additional details to add.

corranrogue9 commented 1 year ago

Potentially destabilizing, let's try investigating in 8.0