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
{{ message }}
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.
We are using Glimpse (Glimpse 1.8.6, Glimpse.Ado 1.7.3, Glimpse.AspNet 1.8.1, Glimpse.EF6 1.6.5, Glimpse.Mvc5 1.5.3) in an ASP.NET MVC 5 application and occasionally experience high CPU usage -- basically, out of nowhere.
Here is what my WinDbg-fu has shown so far.
There are three runaway threads with huge run-times:
User Mode Time
Thread Time
43:1bf8 0 days 0:36:36.375
42:2144 0 days 0:36:28.703
40:cd4 0 days 0:35:38.390
31:23b0 0 days 0:01:29.859
Examining call stacks, all of them are stuck in about the same place:
According to Tess Fernandez, this is how concurrent access to a Dictionary<> instance manifests itself.
Here is what I think is happening. When the GetAlternateRatesForService() methods spins up a Parallel.ForEach, each "parallel worker" threads receives an instance of HttpContext hidden in a Logicall Call Context:
The context instance is now effectively shared between "parallel worker" threads, and it is now a matter of time for GlimpseRuntime.GetTabStore() to be accessed concurrently, which in turn corrupts something inside HttpContext.Items dictionary.
Does this sound plausible?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'll try to be as coherent as possible here.
We are using Glimpse (Glimpse 1.8.6, Glimpse.Ado 1.7.3, Glimpse.AspNet 1.8.1, Glimpse.EF6 1.6.5, Glimpse.Mvc5 1.5.3) in an ASP.NET MVC 5 application and occasionally experience high CPU usage -- basically, out of nowhere.
Here is what my WinDbg-fu has shown so far.
There are three runaway threads with huge run-times:
Examining call stacks, all of them are stuck in about the same place:
According to Tess Fernandez, this is how concurrent access to a
Dictionary<>
instance manifests itself.Here is what I think is happening. When the
GetAlternateRatesForService()
methods spins up aParallel.ForEach
, each "parallel worker" threads receives an instance ofHttpContext
hidden in a Logicall Call Context:The
context
instance is now effectively shared between "parallel worker" threads, and it is now a matter of time forGlimpseRuntime.GetTabStore()
to be accessed concurrently, which in turn corrupts something insideHttpContext.Items
dictionary.Does this sound plausible?
The text was updated successfully, but these errors were encountered: