Note that there are some explanatory texts on larger screens.

plurals
  1. PODeadlock in System.Component.TypeDescriptor
    text
    copied!<p>I have spent a lot of time (googling, reflecting .net binaries, etc) trying to resolve the following problem:</p> <p>I see a deadlock in our application (ASP.NET MVC + EF4). We have several EF's contexts which are created at the beginning of the request and are disposed of at the end. Sometimes we have the following situation: ASP.NET creates a thread per request and then thread enters an "in join or sleep" state when accessing EF context.</p> <p>Majority of the deadlocked threads have a stack trace as follows:</p> <pre><code> System.dll!System.ComponentModel.TypeDescriptor.Refresh(object component, bool refreshReflectionProvider) + 0x97 bytes System.Data.dll!System.Data.SqlClient.SqlCommand.DesignTimeVisible.set(bool value) + 0x22 bytes System.Data.dll!System.Data.SqlClient.SqlCommand.SqlCommand(System.Data.SqlClient.SqlCommand from) + 0xc9 bytes System.Data.dll!System.Data.SqlClient.SqlCommand.Clone() + 0x27 bytes System.Data.dll!System.Data.SqlClient.SqlCommand.System.ICloneable.Clone() + 0x9 bytes System.Data.Entity.dll!System.Data.Common.DbCommandDefinition.CreateCommandDefinition(System.Data.Common.DbCommand prototype) + 0x47 bytes System.Data.Entity.dll!System.Data.SqlClient.SqlProviderServices.CreateDbCommandDefinition(System.Data.Common.DbProviderManifest providerManifest, System.Data.Common.CommandTrees.DbCommandTree commandTree) + 0x21 bytes System.Data.Entity.dll!System.Data.EntityClient.EntityCommandDefinition.EntityCommandDefinition(System.Data.Common.DbProviderFactory storeProviderFactory, System.Data.Common.CommandTrees.DbCommandTree commandTree) + 0x2a1 bytes System.Data.Entity.dll!System.Data.EntityClient.EntityProviderServices.CreateDbCommandDefinition(System.Data.Common.DbProviderManifest providerManifest, System.Data.Common.CommandTrees.DbCommandTree commandTree) + 0x8e bytes System.Data.Entity.dll!System.Data.Objects.Internal.ObjectQueryExecutionPlan.Prepare(System.Data.Objects.ObjectContext context, System.Data.Common.CommandTrees.DbQueryCommandTree tree, System.Type elementType, System.Data.Objects.MergeOption mergeOption, System.Data.Objects.Span span, System.Collections.ObjectModel.ReadOnlyCollection&lt;System.Collections.Generic.KeyValuePair&lt;System.Data.Objects.ObjectParameter,System.Data.Objects.ELinq.QueryParameterExpression&gt;&gt; compiledQueryParameters) + 0x113 bytes System.Data.Entity.dll!System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(System.Data.Objects.MergeOption? forMergeOption) + 0x310 bytes System.Data.Entity.dll!System.Data.Objects.ObjectQuery&lt;CompuTool.Business.Portal.Desktop&gt;.GetResults(System.Data.Objects.MergeOption? forMergeOption) + 0x55 bytes System.Data.Entity.dll!System.Data.Objects.ObjectQuery&lt;System.__Canon&gt;.System.Collections.Generic.IEnumerable&lt;T&gt;.GetEnumerator() + 0x2f bytes System.Core.dll!System.Linq.Enumerable.SingleOrDefault&lt;CompuTool.Business.Portal.Desktop&gt;(System.Collections.Generic.IEnumerable&lt;CompuTool.Business.Portal.Desktop&gt; source) + 0x10f bytes System.Core.dll!System.Linq.Queryable.SingleOrDefault&lt;CompuTool.Business.Portal.Desktop&gt;(System.Linq.IQueryable&lt;CompuTool.Business.Portal.Desktop&gt; source, System.Linq.Expressions.Expression&lt;System.Func&lt;CompuTool.Business.Portal.Desktop,bool&gt;&gt; predicate) + 0x24e bytes &gt; CompuTool.Presentation.Web.dll!CompuTool.Presentation.Web.Controllers.DesktopStateController.ValidateRequest(CompuTool.Business.Portal.DesktopManagerContext dataContext, CompuTool.Business.Portal.User user, int desktopId) Line 30 + 0x19e bytes C# CompuTool.Presentation.Web.dll!CompuTool.Presentation.Web.Controllers.DesktopStateController.SetDesktopState(CompuTool.Business.Portal.User user, int desktopId, string value) Line 65 + 0x17 bytes C# CompuTool.Presentation.Web.dll!CompuTool.Presentation.Web.Controllers.DesktopStateController.Set(int desktopId, string value) Line 111 + 0x13 bytes C# [Lightweight Function] System.Web.Mvc.dll!System.Web.Mvc.ReflectedActionDescriptor.Execute(System.Web.Mvc.ControllerContext controllerContext, System.Collections.Generic.IDictionary&lt;string,object&gt; parameters) + 0x108 bytes System.Web.Mvc.dll!System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionDescriptor actionDescriptor, System.Collections.Generic.IDictionary&lt;string,object&gt; parameters) + 0x27 bytes System.Web.Mvc.dll!System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters.AnonymousMethod__12() + 0x81 bytes System.Web.Mvc.dll!System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(System.Web.Mvc.IActionFilter filter, System.Web.Mvc.ActionExecutingContext preContext, System.Func&lt;System.Web.Mvc.ActionExecutedContext&gt; continuation) + 0xe6 bytes System.Web.Mvc.dll!System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(System.Web.Mvc.ControllerContext controllerContext, System.Collections.Generic.IList&lt;System.Web.Mvc.IActionFilter&gt; filters, System.Web.Mvc.ActionDescriptor actionDescriptor, System.Collections.Generic.IDictionary&lt;string,object&gt; parameters) + 0x13a bytes System.Web.Mvc.dll!System.Web.Mvc.ControllerActionInvoker.InvokeAction(System.Web.Mvc.ControllerContext controllerContext, string actionName) + 0x15f bytes System.Web.Mvc.dll!System.Web.Mvc.Controller.ExecuteCore() + 0x9f bytes System.Web.Mvc.dll!System.Web.Mvc.ControllerBase.Execute(System.Web.Routing.RequestContext requestContext) + 0x14f bytes System.Web.Mvc.dll!System.Web.Mvc.MvcHandler.BeginProcessRequest.AnonymousMethod__5() + 0x3e bytes System.Web.Mvc.dll!System.Web.Mvc.Async.AsyncResultWrapper.MakeVoidDelegate.AnonymousMethod__0() + 0x14 bytes System.Web.Mvc.dll!System.Web.Mvc.MvcHandler.EndProcessRequest.AnonymousMethod__d() + 0x36 bytes System.Web.dll!System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0x1d5 bytes System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step, ref bool completedSynchronously) + 0x177 bytes System.Web.dll!System.Web.HttpApplication.PipelineStepManager.ResumeSteps(System.Exception error) + 0x6f5 bytes System.Web.dll!System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext context, System.AsyncCallback cb) + 0x85 bytes System.Web.dll!System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest wr, System.Web.HttpContext context) + 0x2b6 bytes System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x3bf bytes System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x22 bytes [Native to Managed Transition] [Managed to Native Transition] System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x4f4 bytes System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x22 bytes </code></pre> <p>Is this issue related to incorrect Entity Framework contexts usage? Thanks for help.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload