- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Autofac 用户,现在面临一个非常头痛的问题。电子邮件 Alex 和 Travis 向我提出了这个问题,并得到了他们的答复,在这里,感谢他们的帮助。
为了彻底检查这个问题,我接受了 Travis 的建议,在这里发布了详细信息。
我的邮箱:
We use Autofac 2.6.3.862 in a mvc3 project .
Now we come to the IIS deadlock problem is serious, the server often hanging, we have used the Microsoft Debug Diagnostics Tool to do the analysis (leads to enclose the analysis report ), initially suspected to be a lock in LifetimeScope
I have read your article, but for some technical details are vague to me. Most of our Register() component is SingleInstance, so when Resolve() I doesn't use a a child lifetime scope like using (var scope = Container.BeginLifetimeScope())
, do not know whether this is the reasons of deadlock.
The following threads in
w3wp.exe__hg__PID__3904__Date__03_07_2013__Time_11_01_07AM__974__Manual Dump.dmp are waiting to enter a .NET Lock which thread 39 is currently holding
( 26 34 42 43 44 45 46 47 48 )
16.67% of threads blocked
======================================================================================
Detected possible blocking or leaked critical section at 0x0e758a00 owned by thread 26 in w3wp.exe__hg__PID__3904__Date__03_07_2013__Time_11_01_07AM__974__Manual Dump.dmp
Impact of this lock
1.85% of threads blocked
(Threads 39)
The following functions are trying to enter this critical section
clr!UnsafeEEEnterCriticalSection+1c
The following module(s) are involved with this critical section
C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
======================================================================================
Thread 26 - System ID 7628
Entry point 0x00000000
Create time 2013/3/7 10:44:15
Time spent in user mode 0 Days 00:00:00.218
Time spent in kernel mode 0 Days 00:00:00.343
This thread is waiting to enter a .NET Lock which thread 39 is currently holding
.NET Call Stack
Function
System.Threading.Monitor.ReliableEnter(System.Object, Boolean ByRef)
System.Threading.Monitor.Enter(System.Object, Boolean ByRef)
Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(Autofac.Core.IComponentRegistration, System.Collections.Generic.IEnumerable`1)
Autofac.Core.Container.ResolveComponent(Autofac.Core.IComponentRegistration, System.Collections.Generic.IEnumerable`1)
Autofac.ResolutionExtensions.TryResolveService(Autofac.IComponentContext, Autofac.Core.Service, System.Collections.Generic.IEnumerable`1, System.Object ByRef)
Autofac.ResolutionExtensions.ResolveService(Autofac.IComponentContext, Autofac.Core.Service, System.Collections.Generic.IEnumerable`1)
Autofac.ResolutionExtensions.Resolve[[System.__Canon, mscorlib]](Autofac.IComponentContext, System.Collections.Generic.IEnumerable`1)
Autofac.ResolutionExtensions.Resolve[[System.__Canon, mscorlib]](Autofac.IComponentContext)
Tunynet.DIContainer.Resolve[[System.__Canon, mscorlib]]()
Spacebuilder.Common.ProfileRepository..cctor()
Spacebuilder.Common.ProfileRepository..ctor()
Spacebuilder.Common.UserProfileService..ctor()
Spacebuilder.Common.User.get_Profile()
ASP._Page_Themes_Channel_Default_Views_FindUser__QuickSearch_cshtml.Execute()
System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
Tunynet.UI.ThemedWebViewPage.ExecutePageHierarchy()
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(System.Web.WebPages.WebPageContext, System.IO.TextWriter, System.Web.WebPages.WebPageRenderingBase)
Tunynet.UI.ThemedRazorView.RenderView(System.Web.Mvc.ViewContext, System.IO.TextWriter, System.Object)
System.Web.Mvc.BuildManagerCompiledView.Render(System.Web.Mvc.ViewContext, System.IO.TextWriter)
System.Web.Mvc.ViewResultBase.ExecuteResult(System.Web.Mvc.ControllerContext)
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(System.Web.Mvc.ControllerContext, System.Web.Mvc.ActionResult)
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1c.b__19()
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(System.Web.Mvc.IResultFilter, System.Web.Mvc.ResultExecutingContext, System.Func`1)
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1c+<>c__DisplayClass1e.b__1b()
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(System.Web.Mvc.IResultFilter, System.Web.Mvc.ResultExecutingContext, System.Func`1)
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1c+<>c__DisplayClass1e.b__1b()
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(System.Web.Mvc.IResultFilter, System.Web.Mvc.ResultExecutingContext, System.Func`1)
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1c+<>c__DisplayClass1e.b__1b()
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(System.Web.Mvc.IResultFilter, System.Web.Mvc.ResultExecutingContext, System.Func`1)
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1c+<>c__DisplayClass1e.b__1b()
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(System.Web.Mvc.ControllerContext, System.Collections.Generic.IList`1, System.Web.Mvc.ActionResult)
System.Web.Mvc.ControllerActionInvoker.InvokeAction(System.Web.Mvc.ControllerContext, System.String)
System.Web.Mvc.Controller.ExecuteCore()
System.Web.Mvc.ControllerBase.Execute(System.Web.Routing.RequestContext)
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(System.Web.Routing.RequestContext)
System.Web.Mvc.MvcHandler+<>c__DisplayClass6+<>c__DisplayClassb.b__5()
System.Web.Mvc.Async.AsyncResultWrapper+<>c__DisplayClass1.b__0()
System.Web.Mvc.Async.AsyncResultWrapper+<>c__DisplayClass8`1[[System.Web.Mvc.Async.AsyncVoid, System.Web.Mvc]].b__7(System.IAsyncResult)
System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResult`1[[System.Web.Mvc.Async.AsyncVoid, System.Web.Mvc]].End()
System.Web.Mvc.MvcHandler+<>c__DisplayClasse.b__d()
System.Web.Mvc.SecurityUtil.b__0(System.Action)
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(System.Action)
System.Web.Mvc.MvcHandler.EndProcessRequest(System.IAsyncResult)
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(System.IAsyncResult)
System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep, Boolean ByRef)
System.Web.HttpApplication+PipelineStepManager.ResumeSteps(System.Exception)
System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext, System.AsyncCallback)
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest, System.Web.HttpContext)
System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)
System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)
DomainNeutralILStubClass.IL_STUB_PInvoke(IntPtr, System.Web.RequestNotificationStatus ByRef)
System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr, System.Web.RequestNotificationStatus ByRef)
System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)
System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)
Full Call Stack
Function Source
ntdll!KiFastSystemCallRet
ntdll!NtWaitForMultipleObjects+c
KERNELBASE!WaitForMultipleObjectsEx+100
kernel32!WaitForMultipleObjectsExImplementation+e0
clr!WaitForMultipleObjectsEx_SO_TOLERANT+56
clr!Thread::DoAppropriateAptStateWait+4d
clr!Thread::DoAppropriateWaitWorker+17d
clr!Thread::DoAppropriateWait+60
clr!CLREvent::WaitEx+106
clr!CLREvent::Wait+19
clr!AwareLock::EnterEpilogHelper+a8
clr!AwareLock::EnterEpilog+42
clr!AwareLock::Enter+5f
clr!AwareLock::Contention+228
clr!JITutil_MonReliableContention+e8
System.Threading.Monitor.Enter(System.Object, Boolean ByRef)
clr!CallDescrWorker+33
clr!CallDescrWorkerWithHandler+8e
clr!DispatchCallBody+20
clr!DispatchCallDebuggerWrapper+75
clr!DispatchCallNoEH+53
clr!MethodTable::RunClassInitEx+f1
clr!MethodTable::DoRunClassInitThrowing+53e
clr!MethodDesc::DoPrestub+f1
clr!PreStubWorker+12c
0x00f80842
clr!MethodTable::GetRestoredSlot+2a
clr!MethodDesc::GetMethodEntryPoint+4e
clr!MethodDesc::DoPrestub+51d
clr!PreStubWorker+15d
0x00f80842
System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
System.Collections.Generic.Stack`1[[System.__Canon, mscorlib]].Push(System.__Canon)
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(System.Web.WebPages.WebPageContext, System.IO.TextWriter, System.Web.WebPages.WebPageRenderingBase)
System.RuntimeType+ActivatorCacheEntry..ctor(System.Type, System.RuntimeMethodHandleInternal, Boolean)
System.Web.Mvc.BuildManagerCompiledView.Render(System.Web.Mvc.ViewContext, System.IO.TextWriter)
System.Web.Mvc.ViewResultBase.ExecuteResult(System.Web.Mvc.ControllerContext)
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(System.Web.Mvc.ControllerContext, System.Web.Mvc.ActionResult)
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19()
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(System.Web.Mvc.IResultFilter, System.Web.Mvc.ResultExecutingContext, System.Func`1<System.Web.Mvc.ResultExecutedContext>)
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1c+<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b()
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1c+<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b()
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1c+<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b()
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1c+<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b()
System.Web.Mvc.ControllerActionInvoker.InvokeAction(System.Web.Mvc.ControllerContext, System.String)
System.Web.Mvc.Controller.ExecuteCore()
System.Web.Mvc.ControllerBase.Execute(System.Web.Routing.RequestContext)
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(System.Web.Routing.RequestContext)
System.Web.Mvc.MvcHandler+<>c__DisplayClass6+<>c__DisplayClassb.<BeginProcessRequest>b__5()
System.Web.Mvc.Async.AsyncResultWrapper+<>c__DisplayClass1.<MakeVoidDelegate>b__0()
System.Web.Mvc.MvcHandler+<>c__DisplayClasse.<EndProcessRequest>b__d()
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(System.Action)
System.Web.Mvc.MvcHandler.EndProcessRequest(System.IAsyncResult)
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(System.IAsyncResult)
System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep, Boolean ByRef)
System.Web.HttpApplication+PipelineStepManager.ResumeSteps(System.Exception)
System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext, System.AsyncCallback)
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest, System.Web.HttpContext)
System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)
System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)
webengine4!W3_MGD_HANDLER::ProcessNotification+5b
webengine4!W3_MGD_HANDLER::DoWork+250
webengine4!RequestDoWork+2da
webengine4!CMgdEngHttpModule::OnExecuteRequestHandler+1a
iiscore!NOTIFICATION_CONTEXT::RequestDoWork+128
iiscore!NOTIFICATION_CONTEXT::CallModulesInternal+305
iiscore!NOTIFICATION_CONTEXT::CallModules+28
iiscore!W3_CONTEXT::DoStateRequestExecuteHandler+36
iiscore!W3_CONTEXT::DoWork+d7
iiscore!W3_MAIN_CONTEXT::ContinueNotificationLoop+1f
iiscore!W3_MAIN_CONTEXT::ProcessIndicateCompletion+1f
iiscore!W3_CONTEXT::IndicateCompletion+75
webengine4!W3_MGD_HANDLER::IndicateCompletion+3d
webengine4!MgdIndicateCompletion+24
DomainNeutralILStubClass.IL_STUB_PInvoke(IntPtr, System.Web.RequestNotificationStatus ByRef)
System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)
System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)
clr!UM2MThunk_WrapperHelper+10
clr!UM2MThunk_Wrapper+8c
clr!Thread::DoADCallBack+f0
clr!UM2MDoADCallBack+c0
0x00f98c20
webengine4!W3_MGD_HANDLER::ProcessNotification+5b
webengine4!ProcessNotificationCallback+36
clr!UnManagedPerAppDomainTPCount::DispatchWorkItem+195
clr!ThreadpoolMgr::NewWorkerThreadStart+20b
clr!ThreadpoolMgr::WorkerThreadStart+3d1
clr!Thread::intermediateThreadProc+4b
kernel32!BaseThreadInitThunk+e
ntdll!__RtlUserThreadStart+70
ntdll!_RtlUserThreadStart+1b
=========================================================================
Thread 39 - System ID 4176
Entry point 0x00000000
Create time 2013/3/7 10:44:21
Time spent in user mode 0 Days 00:00:00.140
Time spent in kernel mode 0 Days 00:00:00.109
This thread is not fully resolved and may or may not be a problem. Further analysis of these threads may be required.
.NET Call Stack
Function
Spacebuilder.Common.ProfileRepository..ctor()
Spacebuilder.Common.UserProfileService..ctor()
Spacebuilder.Common.UserSearcher..ctor(System.String, System.String, Boolean, Int32)
Spacebuilder.Environments.Starter.b__54(Autofac.IComponentContext)
Autofac.RegistrationExtensions+<>c__DisplayClass10`1[[System.__Canon, mscorlib]].b__f(Autofac.IComponentContext, System.Collections.Generic.IEnumerable`1)
Autofac.Builder.RegistrationBuilder+<>c__DisplayClass1`1[[System.__Canon, mscorlib]].b__0(Autofac.IComponentContext, System.Collections.Generic.IEnumerable`1)
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(Autofac.IComponentContext, System.Collections.Generic.IEnumerable`1)
Autofac.Core.Resolving.InstanceLookup.Activate(System.Collections.Generic.IEnumerable`1)
Autofac.Core.Resolving.InstanceLookup.b__0()
Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(System.Guid, System.Func`1)
Autofac.Core.Resolving.InstanceLookup.Execute()
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(Autofac.Core.ISharingLifetimeScope, Autofac.Core.IComponentRegistration, System.Collections.Generic.IEnumerable`1)
Autofac.Core.Resolving.InstanceLookup.ResolveComponent(Autofac.Core.IComponentRegistration, System.Collections.Generic.IEnumerable`1)
Autofac.Features.Collections.CollectionRegistrationSource+<>c__DisplayClass4+<>c__DisplayClass6.b__1(Autofac.Core.IComponentRegistration)
System.Linq.Enumerable+WhereSelectArrayIterator`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]].MoveNext()
System.Linq.Buffer`1[[System.__Canon, mscorlib]]..ctor(System.Collections.Generic.IEnumerable`1)
System.Linq.Enumerable.ToArray[[System.__Canon, mscorlib]](System.Collections.Generic.IEnumerable`1)
Autofac.Features.Collections.CollectionRegistrationSource+<>c__DisplayClass4.b__0(Autofac.IComponentContext, System.Collections.Generic.IEnumerable`1)
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(Autofac.IComponentContext, System.Collections.Generic.IEnumerable`1)
Autofac.Core.Resolving.InstanceLookup.Activate(System.Collections.Generic.IEnumerable`1)
Autofac.Core.Resolving.InstanceLookup.Execute()
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(Autofac.Core.ISharingLifetimeScope, Autofac.Core.IComponentRegistration, System.Collections.Generic.IEnumerable`1)
Autofac.Core.Resolving.ResolveOperation.Execute(Autofac.Core.IComponentRegistration, System.Collections.Generic.IEnumerable`1)
Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(Autofac.Core.IComponentRegistration, System.Collections.Generic.IEnumerable`1)
Autofac.Core.Container.ResolveComponent(Autofac.Core.IComponentRegistration, System.Collections.Generic.IEnumerable`1)
Autofac.ResolutionExtensions.TryResolveService(Autofac.IComponentContext, Autofac.Core.Service, System.Collections.Generic.IEnumerable`1, System.Object ByRef)
Autofac.ResolutionExtensions.ResolveService(Autofac.IComponentContext, Autofac.Core.Service, System.Collections.Generic.IEnumerable`1)
Autofac.ResolutionExtensions.Resolve[[System.__Canon, mscorlib]](Autofac.IComponentContext, System.Collections.Generic.IEnumerable`1)
Autofac.ResolutionExtensions.Resolve[[System.__Canon, mscorlib]](Autofac.IComponentContext)
Tunynet.DIContainer.Resolve[[System.__Canon, mscorlib]]()
Spacebuilder.Search.SearcherFactory.GetSearcher(System.String)
Spacebuilder.Common.FindUserController._InterestedWithAll(Int32, Int32, System.String)
DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure, System.Web.Mvc.ControllerBase, System.Object[])
System.Web.Mvc.ActionMethodDispatcher.Execute(System.Web.Mvc.ControllerBase, System.Object[])
System.Web.Mvc.ReflectedActionDescriptor.Execute(System.Web.Mvc.ControllerContext, System.Collections.Generic.IDictionary`2)
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(System.Web.Mvc.ControllerContext, System.Web.Mvc.ActionDescriptor, System.Collections.Generic.IDictionary`2)
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass15.b__12()
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(System.Web.Mvc.IActionFilter, System.Web.Mvc.ActionExecutingContext, System.Func`1)
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass15+<>c__DisplayClass17.b__14()
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(System.Web.Mvc.IActionFilter, System.Web.Mvc.ActionExecutingContext, System.Func`1)
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass15+<>c__DisplayClass17.b__14()
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(System.Web.Mvc.IActionFilter, System.Web.Mvc.ActionExecutingContext, System.Func`1)
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass15+<>c__DisplayClass17.b__14()
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(System.Web.Mvc.ControllerContext, System.Collections.Generic.IList`1, System.Web.Mvc.ActionDescriptor, System.Collections.Generic.IDictionary`2)
System.Web.Mvc.ControllerActionInvoker.InvokeAction(System.Web.Mvc.ControllerContext, System.String)
System.Web.Mvc.Controller.ExecuteCore()
System.Web.Mvc.ControllerBase.Execute(System.Web.Routing.RequestContext)
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(System.Web.Routing.RequestContext)
System.Web.Mvc.MvcHandler+<>c__DisplayClass6+<>c__DisplayClassb.b__5()
System.Web.Mvc.Async.AsyncResultWrapper+<>c__DisplayClass1.b__0()
System.Web.Mvc.Async.AsyncResultWrapper+<>c__DisplayClass8`1[[System.Web.Mvc.Async.AsyncVoid, System.Web.Mvc]].b__7(System.IAsyncResult)
System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResult`1[[System.Web.Mvc.Async.AsyncVoid, System.Web.Mvc]].End()
System.Web.Mvc.MvcHandler+<>c__DisplayClasse.b__d()
System.Web.Mvc.SecurityUtil.b__0(System.Action)
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(System.Action)
System.Web.Mvc.MvcHandler.EndProcessRequest(System.IAsyncResult)
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(System.IAsyncResult)
System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep, Boolean ByRef)
System.Web.HttpApplication+PipelineStepManager.ResumeSteps(System.Exception)
System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext, System.AsyncCallback)
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest, System.Web.HttpContext)
System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)
System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)
DomainNeutralILStubClass.IL_STUB_PInvoke(IntPtr, System.Web.RequestNotificationStatus ByRef)
System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr, System.Web.RequestNotificationStatus ByRef)
System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)
System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)
Full Call Stack
Function Source
ntdll!KiFastSystemCallRet
ntdll!NtWaitForSingleObject+c
ntdll!RtlpWaitOnCriticalSection+13e
ntdll!RtlEnterCriticalSection+150
clr!UnsafeEEEnterCriticalSection+1c
clr!CrstBase::Enter+1ad
clr!ListLockEntry::FinishDeadlockAwareEnter+25
clr!ListLockEntry::LockHolder::DeadlockAwareAcquire+28
clr!MethodTable::DoRunClassInitThrowing+4c2
clr!MethodDesc::DoPrestub+f1
clr!PreStubWorker+12c
0x00f80842
clr!PreStubWorker+165
System.Linq.Enumerable+WhereSelectArrayIterator`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]].MoveNext()
System.Linq.Buffer`1[[System.__Canon, mscorlib]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
System.Linq.Enumerable.ToArray[[System.__Canon, mscorlib]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
System.Collections.Generic.Stack`1[[System.__Canon, mscorlib]].Push(System.__Canon)
clr!JIT_Stelem_Ref+25
System.Collections.Generic.Stack`1[[System.__Canon, mscorlib]].Push(System.__Canon)
This does sound like a tricky one. What is the DIContainer class doing and do you have any components registered as InstancePerHttpRequest, or InstancePerLifetimeScope? There also seems to be some Quartz jobs in the background too, how are they interacting with the container?
A very quick look at the stack trace indicates you may have some long-running operations or locks happening in the Spacebuilder.Environments.Starter, Spacebuilder.Common.UserSearcher.ctor, Spacebuilder.UserProfileService.ctor, or Spacebuilder.Common.ProfileRepository. What I'm seeing that's interesting is that during a RESOLVE operation, when whatever component it is gets RESOLVED, there's an internal REGISTER going on. Without seeing the code, I can't tell you what's going on there, but that thread - #39 - that's the stuff I'd look at.
It looks like... A controller action is being invoked There's some sort of lambda running over a closure (DynamicClass.lambda_method) - something custom in your pipeline. SearcherFactory.GetSearcher manually tries to resolve smoething. During the resolution in GetSearcher, something is asking for a collection - like an IEnumerable of services. A constructor parameter? Here's where it gets weird: while resolving that IEnumerable, a new lifetime scope is getting created and something appears to be getting registered in it? The LifetimeScope.ResolveComponent call does do a lock to make sure resolutions are thread-safe. The fact you're getting a deadlock means two different threads are trying to resolve out of the same lifetime scope (the container?) at the same time, which, in MVC, is something to avoid - you probably wouldn't run into this, for example, if you were resolving only out of the HttpRequest lifetime scope since you'd only have that on one thread at a time. Alternatively, you may be passing lifetime scopes around in the app for the purposes of doing service location and that, too, can be a red flag.
There is a wiki page on Concurrency that can also give you some pointers: https://code.google.com/p/autofac/wiki/Concurrency
If that doesn't get you going in the direction you need, I recommend posting to the discussion forum since, again, I'm not really able to provide individual help necessarily in a timely fashion. That will get other eyes on it and may get you help sooner. You'll want to include: A description of the problem (like was in this email) but with more detail about what you expect to happen (e.g., you're accessing a controller action that does blah blah blah). The stack trace of the blocking thread. The code around where things are getting blocked: Your initial ContainerBuilder registrations to show how things are getting registered. What's in those constructors and things that are getting hung. That info will help folks more quickly root out the problem. That's also the stuff you should be looking at with respect to things getting locked
containerBuilder.Register(c => new DefaultCacheService(new MemcachedCache())).As<ICacheService>().SingleInstance();
containerBuilder.Register(c => new QuartzTaskScheduler()).As<ITaskScheduler>().SingleInstance();
containerBuilder.Register(c => new UserService()).As<IUserService>().SingleInstance();
containerBuilder.Register(c => new UserSearcher("~/App_Data/IndexFiles/User")).As<ISearcher>().SingleInstance();
containerBuilder.Register(c => new TagSearcher("~/App_Data/IndexFiles/Tag")).As<ISearcher>().SingleInstance();
containerBuilder.Register(c => new FormsAuthenticationService()).As<IAuthenticationService>().InstancePerHttpRequest();
IContainer container = containerBuilder.Build();
DIContainer.RegisterContainer(container);
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
public class DIContainer
{
private static IContainer _container;
public static void RegisterContainer(IContainer container)
{
_container = container;
}
public static TService Resolve<TService>()
{
return _container.Resolve<TService>();
}
......
}
public static ISearcher GetSearcher(string IndexPath)
{
return DIContainer.Resolve<IEnumerable<ISearcher>>().Where(s => s.IndexPath.Equals(IndexPath, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
}
最佳答案
Resolve Method 的内部实现是 LifetimeScope.GetOrCreateAndShare,该方法使用线程锁。查看ProfileRepository的静态构造函数,可能是构造函数的线程锁和autofac的线程锁构成了死锁。
关于iis - Autofac 引起的棘手的 IIS 死锁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15286230/
当我查看 IIS 日志文件时,我可以在一天中的不同时间看到标题行被写入日志文件。我唯一一次看到这种情况发生是在 IIS 重置时;或启动。 例如下面的标题行; #Software: Microsoft
有谁知道为什么以下 web.conig 更改不起作用: 在我添加 javascript 文件后仍然没有被压缩(gzip)。我折腾了几天,因为一开始我真的不知道问题是
目前,我们所有的网络应用程序都将其应用程序池标识设置为 ApplicationPoolIdentity。现在,当一个应用程序需要访问某些服务器上的某些资源时,比如添加/读取某些文件,该应用程序会在代码
在 IIS(特别是 6.0)中,在“主目录”选项卡下,如果我更改本地路径,是否会导致 IIS 重新启动或应用程序池回收? 相关的,是否有概述 IIS 元数据库的哪些更改将触发重新启动或应用程序池回收的
只要更改了任何 web.config 文件,AFAIK IIS 就会重新启动。 我创建了自己的配置文件(my.config,层次结构略有不同)。是否有可能让 IIS 自动(自动神奇地 :))重新启动,
你好, 我正在寻找 IIS 日志中列出的浏览器条目列表,以帮助识别访问我们网站的不同版本的浏览器。也许没有一个列表,而是一个应该用来识别不同浏览器及其版本的算法。 请注意,我不是在寻找日志分析器,而是
我想知道上次重新启动 iis 是什么时候。 IIS 是否保留了此日志,我在哪里可以找到此日志? 谢谢 最佳答案 打开事件查看器,导航到“Windows 日志”->“系统” 在右侧的“操作” Pane
在全新安装的带有 IIS 7 的 Windows Server 2008 R2 上,它会在 C:\inetpub\wwwroot 中创建一个默认网站。 .我确信对于存储网站文件的好位置有很多主观意见,
我已按照 this question 中的说明在 IIS 中实现动态内容压缩。 . 当我发送请求时,我看不到响应被 gzip 压缩的任何证据: IIS版本为7.5 有什么明显的我应该检查以解决此问题吗
这是场景: 服务器 A 托管“主”应用程序 (www.example.com) 服务器 B 托管支持应用程序 (b.example.com) 它们通过 192.* 地址在内部相互连接,并且都可以通过
是否有任何替代 IIS 管理 UI 可用于从程序重置 IIS?.. 现在我们已经创建了一个批处理文件,如果 iis 重置并每小时安排一次...... 我只是想要一些东西,这样我们就不能重置 iis..
我的 Windows Server 在 IIS 7.5 上运行 Web 应用程序。 我想知道为什么 IIS 应用程序池使用大量内存。 请参阅我从服务器捕获的屏幕截图。 在名为 TEST 2.0(.NE
我在 IIS 7.5 上运行的 ASP Classic 站点上收到服务器错误。 我将“向浏览器发送错误”设置为 True ,但是我仍然收到以下错误屏幕: 最佳答案 IIS 正在劫持您的经典 ASP 应
我正在尝试通过IIS上的反向代理连接到websockets服务器(websockify)。 IIS和Websockets服务器位于同一台物理服务器上(Windows Server 2012 R2,II
我需要让我的开发机器从本地机器商店读取证书 为此,我需要运行winhttpcertcfg.exe并指定我要提升的帐户 该帐户用于IIS表示什么? (对于IIS,它将是IWAM_MachineName)
我正在阅读特定命令(SET-WEBCONFIGURATIONPROPERTY),但出现"is not recognized as a cmdlet"错误。给我的建议是,即使我使用的是SharePoin
我已经为 IIS8 安装了静态和动态压缩并启用了它。 当我的CPU性能100%时,我的GZIP IIS不工作,为什么? 我可以清楚地看到 GZIP 没有在 Live HTTP header 中运行。我
我已经从官方镜像(https://hub.docker.com/r/microsoft/iis/)运行了IIS 在Windows Server 2016上 有什么方法可以从IIS管理器连接到该IIS,
你好, 如果 iis 未运行,我想编写一个状态为的代码。 最佳答案 从命令行启动 IIS: iisreset /start 从命令行停止 IIS: iisreset /stop 重新启动(停止和启动)
我已经为 IIS8 安装了静态和动态压缩并启用了它。 当我的CPU性能100%时,我的GZIP IIS不工作,为什么? 我可以清楚地看到 GZIP 没有在 Live HTTP header 中运行。我
我是一名优秀的程序员,十分优秀!