我们间歇性地导致特定用户的请求挂起。发生这种情况时,我们的负载均衡器将在1分钟后返回504。这样,用户在尝试刷新时将不会获得响应。对于其他用户,该站点仍然可以正常运行。
我已经使用WinDbg来检查线程,并且某些线程似乎正在等待Redis调用而被挂起,因此我假设存在某种死锁情况。
示例线程:
0:052> !clrstack
OS Thread Id: 0x584 (52)
Child SP IP Call Site
00000015d5b0db38 00007ffef91206fa [InlinedCallFrame: 00000015d5b0db38] StackExchange.Redis.SocketManager.select(Int32, IntPtr[], IntPtr[], IntPtr[], TimeValue ByRef)
00000015d5b0db38 00007ffe962b2b51 [InlinedCallFrame: 00000015d5b0db38] StackExchange.Redis.SocketManager.select(Int32, IntPtr[], IntPtr[], IntPtr[], TimeValue ByRef)
00000015d5b0db00 00007ffe962b2b51 DomainBoundILStubClass.IL_STUB_PInvoke(Int32, IntPtr[], IntPtr[], IntPtr[], TimeValue ByRef)
00000015d5b0dbe0 00007ffe962b20f1 StackExchange.Redis.SocketManager.ReadImpl()
00000015d5b0ddc0 00007ffe962b1496 StackExchange.Redis.SocketManager.Read()
00000015d5b0de00 00007ffeed45ca72 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
00000015d5b0ded0 00007ffeed45c904 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
00000015d5b0df00 00007ffeed45c8c2 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
00000015d5b0df50 00007ffeede3100c System.Threading.ThreadHelper.ThreadStart(System.Object)
00000015d5b0e1a8 00007ffeeeb66793 [GCFrame: 00000015d5b0e1a8]
00000015d5b0e4f8 00007ffeeeb66793 [DebuggerU2MCatchHandlerFrame: 00000015d5b0e4f8]
00000015d5b0e688 00007ffeeeb66793 [ContextTransitionFrame: 00000015d5b0e688]
00000015d5b0e8b8 00007ffeeeb66793 [DebuggerU2MCatchHandlerFrame: 00000015d5b0e8b8]
并且:
0:050> !clrstack
OS Thread Id: 0x2784 (50)
Child SP IP Call Site
00000015d51ae118 00007ffef9120c6a [GCFrame: 00000015d51ae118]
00000015d51ae1e8 00007ffef9120c6a [HelperMethodFrame_1OBJ: 00000015d51ae1e8] System.Threading.Monitor.ObjWait(Boolean, Int32, System.Object)
00000015d51ae300 00007ffe962a15cc StackExchange.Redis.SocketManager.WriteAllQueues()
00000015d51ae380 00007ffe962a134f StackExchange.Redis.SocketManager.b__1e(System.Object)
00000015d51ae3c0 00007ffeed45ca72 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
00000015d51ae490 00007ffeed45c904 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
00000015d51ae4c0 00007ffeed45c8c2 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
00000015d51ae510 00007ffeede3100c System.Threading.ThreadHelper.ThreadStart(System.Object)
00000015d51ae768 00007ffeeeb66793 [GCFrame: 00000015d51ae768]
00000015d51aeab8 00007ffeeeb66793 [DebuggerU2MCatchHandlerFrame: 00000015d51aeab8]
00000015d51aec48 00007ffeeeb66793 [ContextTransitionFrame: 00000015d51aec48]
00000015d51aee78 00007ffeeeb66793 [DebuggerU2MCatchHandlerFrame: 00000015d51aee78]
This问题似乎很相似,但是我没有直接调用StackExchange.Redis库。而是将其配置为现成的Sitecore会话提供程序。因此,我们通过标准的ASP.NET API与之交互:
HttpContext.Current.Session["object"] = object;
此问题可能是什么原因,和/或我可以采取哪些其他步骤来确定原因?