Narochno / Narochno.Credstash

C# Implementation of Credstash
Apache License 2.0
10 stars 9 forks source link

Update versions, and fix concurrent access problem #22

Closed Meister1977 closed 6 years ago

Meister1977 commented 6 years ago

We get this exception, and this is why I changed Dictionary to ConcurrentDictionary:

Result StackTrace:
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Narochno.Credstash.Configuration.CredstashConfigurationProvider.Load() at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList1 providers) at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() at ...

----- Inner Stack Trace ----- at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at Narochno.Credstash.Configuration.CredstashConfigurationProvider.SetConfigValueAsync(Dictionary2 data, String entry) at Narochno.Credstash.Configuration.CredstashConfigurationProvider.<>cDisplayClass6_0.<b1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Narochno.Credstash.Configuration.ParallelExtensions.<>cDisplayClass0_1`1.<b1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Narochno.Credstash.Configuration.CredstashConfigurationProvider.LoadAsync() Result Message: System.AggregateException : One or more errors occurred. (Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.) ---- System.InvalidOperationException : Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.