Make concurrency check handle re-entrance
See original GitHub issueGetting exception below when making Async calls.
Exception message:
A second operation started on this context before a previous operation completed. Any instance members are not guaranteed to be thread safe.
Stack trace:
at Microsoft.EntityFrameworkCore.Internal.ConcurrencyDetector.EnterCriticalSection()
at Microsoft.EntityFrameworkCore.Internal.ConcurrencyDetector.<EnterCriticalSectionAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.<MoveNext>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.AspNetCore.Identity.RoleManager`1.<RoleExistsAsync>d__34.MoveNext()
roleManager.CreateAsync(new ApplicationRole() { Name = role.Key, NormalizedName = role.Key.ToUpper(), System = true, Description = role.Value });
}
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.Design": {
"type": "build",
"version": "1.1.0"
},
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Make concurrency check handle re-entrance · Issue #7375
This is a common user error. No two sync or async operations can be in flight at the same time. All ...
Read more >java - Is this the correct approach to achieve concurrency?
As I am not using any DB, I have created lock on the Account class itself using reentrant lock. Now when I am...
Read more >Writing reentrant and threadsafe code
In single-threaded processes, only one flow of control exists. The code executed by these processes thus need not be reentrant or threadsafe.
Read more >Coordinating Between Threads Using Reentrant Locks
The reason you'd do this is so that you can then make each method that needs a particular lock to manage its own...
Read more >Sessions, Instancing, and Concurrency - WCF
A session is a correlation of all messages sent between two endpoints. Instancing refers to controlling the lifetime of user-defined service ...
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 Free
Top 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
@divega @anpete Should we try to make this work? It’s not multiple threads, but rather one query that has calls that are (I assume) funcletized and themselves execute queries.
Fixed in #17089