You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Short summary (3-5 sentences) describing the issue.
I encountered the following error in OData Client while debugging another issue (#2532). It occurred while running a sample program that executes two requests concurrently. The error is hard to reproduce, I had to run the program repeatedly to reproduce it. I didn't investigate it further, but it could be race condition.
Unhandled exception. System.AggregateException: One or more errors occurred. (The complex type 'System.Collections.Generic.IDictionary`2[System.String,System.Object]' has no settable properties.)
---> System.InvalidOperationException: The complex type 'System.Collections.Generic.IDictionary`2[System.String,System.Object]' has no settable properties.
at Microsoft.OData.Client.ClientEdmModel.ValidateComplexType(Type type, EdmTypeCacheValue cachedEdmType)
at Microsoft.OData.Client.ClientEdmModel.GetOrCreateEdmType(Type type)
at Microsoft.OData.Client.ClientEdmModel.CreateEdmProperty(IEdmStructuredType declaringType, PropertyInfo propertyInfo)
at Microsoft.OData.Client.ClientEdmModel.<>c__DisplayClass37_0.<GetOrCreateEdmTypeInternal>b__0(EdmEntityTypeWithDelayLoadedProperties entityType)
at Microsoft.OData.Client.Providers.EdmEntityTypeWithDelayLoadedProperties.EnsurePropertyLoaded()
at Microsoft.OData.Client.Providers.EdmEntityTypeWithDelayLoadedProperties.get_DeclaredProperties()
at Microsoft.OData.Client.Metadata.ClientTypeAnnotation.DiscoverEdmProperties()+MoveNext()
at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.OData.Client.Metadata.ClientTypeAnnotation.EdmProperties()
at Microsoft.OData.Client.Metadata.ClientTypeAnnotation.BuildPropertyCache()
at Microsoft.OData.Client.Metadata.ClientTypeAnnotation.GetProperty(String propertyName, UndeclaredPropertyBehavior undeclaredPropertyBehavior)
at Microsoft.OData.Client.Materialization.StructuralValueMaterializationPolicy.MaterializeDataValues(ClientTypeAnnotation actualType, IEnumerable`1 values, UndeclaredPropertyBehavior undeclaredPropertyBehavior)
at Microsoft.OData.Client.Materialization.EntryValueMaterializationPolicy.MaterializeResolvedEntry(MaterializerEntry entry, Boolean includeLinks)
at Microsoft.OData.Client.Materialization.EntryValueMaterializationPolicy.Materialize(MaterializerEntry entry, Type expectedEntryType, Boolean includeLinks)
at Microsoft.OData.Client.Materialization.ODataEntityMaterializer.DirectMaterializePlan(ODataEntityMaterializer materializer, MaterializerEntry entry, Type expectedEntryType)
at Microsoft.OData.Client.Materialization.ODataEntityMaterializerInvoker.DirectMaterializePlan(Object materializer, Object entry, Type expectedEntryType)
at Microsoft.OData.Client.ProjectionPlan.Run(ODataEntityMaterializer materializer, ODataResource entry, Type expectedType)
at Microsoft.OData.Client.Materialization.ODataEntityMaterializer.ReadImplementation()
at Microsoft.OData.Client.MaterializeAtom.MoveNextInternal()
at Microsoft.OData.Client.MaterializeAtom.MoveNext()
at System.Linq.Enumerable.CastIterator[TResult](IEnumerable source)+MoveNext()
at ODataClientExample.Program.GetPeople(DefaultContainer context) in C:\Users\clhabins\source\experiments\ODataClientDuplicateEdmTypeRaceCondition\ODataClientDuplicateEdmTypeRaceCondition\Program.cs:line 40
at ODataClientExample.Program.ConcurrentMixedRequests() in C:\Users\clhabins\source\experiments\ODataClientDuplicateEdmTypeRaceCondition\ODataClientDuplicateEdmTypeRaceCondition\Program.cs:line 128
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at ODataClientExample.Program.Main(String[] args) in C:\Users\clhabins\source\experiments\ODataClientDuplicateEdmTypeRaceCondition\ODataClientDuplicateEdmTypeRaceCondition\Program.cs:line 18
Short summary (3-5 sentences) describing the issue.
I encountered the following error in OData Client while debugging another issue (#2532). It occurred while running a sample program that executes two requests concurrently. The error is hard to reproduce, I had to run the program repeatedly to reproduce it. I didn't investigate it further, but it could be race condition.
Affected assemblies
Microsoft.OData.Core 7.12.2
Reproduce steps
Run the sample program in this repo repeatedly: https://github.com/habbes/experiments/tree/master/ODataClientDuplicateEdmTypeRaceCondition,
In my case I had it running in a loop by entering the following command in a Powershell terminal:
Expected result
No error should occur.
Actual result
The exception above occurs.
Additional detail
Optional, details of the root cause if known. Delete this section if you have no additional details to add.
The text was updated successfully, but these errors were encountered: