Iis 调试信号器挂起

Iis 调试信号器挂起,iis,signalr,Iis,Signalr,Windows 7,信号2 我有一些HelloWorld信号器代码,可以在一个VS2013项目中使用(即,我的信号器hello world游乐场) 当我向现有应用程序添加相同的代码时,信号器线程在IIS中“永远”挂起。这种情况每次都会发生 我的信号机控制台看起来像: 我的perfMon计数器如下所示: 我的工作进程列表如下所示: 我想了解一些从哪里开始调试的技巧。在Java中,我会进行一次线程转储,我可以很容易地看到发生了什么 当作为调试器连接时,这些线程在VS2013中不可见 在IIS/

Windows 7,信号2

我有一些HelloWorld信号器代码,可以在一个VS2013项目中使用(即,我的信号器hello world游乐场)

当我向现有应用程序添加相同的代码时,信号器线程在IIS中“永远”挂起。这种情况每次都会发生

我的信号机控制台看起来像:

我的perfMon计数器如下所示:

我的工作进程列表如下所示:

我想了解一些从哪里开始调试的技巧。在Java中,我会进行一次线程转储,我可以很容易地看到发生了什么

当作为调试器连接时,这些线程在VS2013中不可见

在IIS/DotNet中似乎没有等效物

这是我的中心:

 public class Ep1DataImportHub : Hub
{
     public int recordsToBeProcessed = 100000;

        public void DoLongOperation()
        {
            for (int record = 0; record <= recordsToBeProcessed; record++)
            {
                if (ShouldNotifyClient(record))
                {
                    Clients.Caller.sendMessage(string.Format
                    ("Processing item {0} of {1}", record, recordsToBeProcessed));
                    Thread.Sleep(10);
                }
            }
        }

        private static bool ShouldNotifyClient(int record)
        {
            return record % 10 == 0;
        }
    }  
对于信号器1,IIS中有很多关于信号器挂起的信息,但我使用的是信号器2

有人能告诉我如何开始调试正在发生的事情吗。这个工具看起来很有趣,但我不知道它是什么()

下面是其中一个卡住线程的托管调用堆栈

System_Web_ni!DomainNeutralILStubClass.IL_STUB_PInvoke(IntPtr, Boolean, Boolean ByRef)+8f 
[[InlinedCallFrame] (System.Web.Hosting.UnsafeIISMethods.MgdExplicitFlush)] System.Web.Hosting.UnsafeIISMethods.MgdExplicitFlush(IntPtr, Boolean, BooleanByRef) 
System_Web_ni!System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()+20 
System_Web_ni!System.Web.HttpResponse.Flush(Boolean, Boolean)+c3 
System_Web_ni!System.Web.HttpWriter.WriteFromStream(Byte[], Int32, Int32)+a0 
Microsoft.Owin.Host.SystemWeb.CallStreams.DelegatingStream.Write(Byte[], Int32, Int32)+3a 
Microsoft.Owin.Host.SystemWeb.CallStreams.OutputStream.Write(Byte[], Int32, Int32)+3b 
Microsoft.AspNet.SignalR.Owin.ServerResponse.Write(System.ArraySegment`1)+24 
Microsoft.AspNet.SignalR.Hosting.ResponseExtensions.End(Microsoft.AspNet.SignalR.Hosting.IResponse, System.String)+c8 
Microsoft.AspNet.SignalR.PersistentConnection+d__f.MoveNext()+180 
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+285 
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+9 
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()+a4 
System_Web_ni!System.Web.Util.SynchronizationHelper.SafeWrapCallback(System.Action)+b4 
mscorlib_ni!System.Threading.Tasks.Task.Execute()+6e 
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+285 
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+9 
mscorlib_ni!System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)+250 
mscorlib_ni!System.Threading.Tasks.Task.ExecuteEntry(Boolean)+85 
mscorlib_ni!System.Threading.ThreadPoolWorkQueue.Dispatch()+1ea 
[[DebuggerU2MCatchHandlerFrame]] 
[[ContextTransitionFrame]] 
[[DebuggerU2MCatchHandlerFrame]] 

您是否碰巧定义了
Application\u PreSendRequestHeaders
方法,或者您是否以其他方式附加到
HttpApplication.PreSendRequestHeaders
事件

我问,因为这似乎是报道的同一个问题。对于该线程上的某些人,删除PreSendRequestHeaders事件处理程序解决了该问题

我们正在积极地为2.1.1进行修复


如果您没有附加到PreSendRequestHeaders事件,我们(信号员团队)可以使用您的帮助。到目前为止,如果不附加PreSendRequestHeaders事件,我们无法重现此问题。如果您能为我们提供一个应用程序,该应用程序不附加到此事件,但仍以这种方式挂起,我们将不胜感激


早期版本的SignalR(2.0.3)没有向/SignalR/start发出请求,也没有遇到此挂起。因此,您可以通过从SignalR 2.1.0降级到2.0.3,暂时解决此问题,直到2.1.1发布。

我们将此问题追溯到Spile.ASPNet。它将自身附加到PresandRequestHeader。因此,如果您使用signar的scape.ASPNet,您可能会发现线程“永远”锁定


删除Spile.AspNet解决了这个问题

我们不直接使用“Application.PreSendRequestHeaders”,我们确实使用了一些插件,如Spile、RoutedBugHandler、Moxi等。今天我将尝试创建一个简单的回购应用程序,并将其发送给您。在SignalR 2.2.0/SignalR/start上,随机挂起。我不知道如何调试这个。
System_Web_ni!DomainNeutralILStubClass.IL_STUB_PInvoke(IntPtr, Boolean, Boolean ByRef)+8f 
[[InlinedCallFrame] (System.Web.Hosting.UnsafeIISMethods.MgdExplicitFlush)] System.Web.Hosting.UnsafeIISMethods.MgdExplicitFlush(IntPtr, Boolean, BooleanByRef) 
System_Web_ni!System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()+20 
System_Web_ni!System.Web.HttpResponse.Flush(Boolean, Boolean)+c3 
System_Web_ni!System.Web.HttpWriter.WriteFromStream(Byte[], Int32, Int32)+a0 
Microsoft.Owin.Host.SystemWeb.CallStreams.DelegatingStream.Write(Byte[], Int32, Int32)+3a 
Microsoft.Owin.Host.SystemWeb.CallStreams.OutputStream.Write(Byte[], Int32, Int32)+3b 
Microsoft.AspNet.SignalR.Owin.ServerResponse.Write(System.ArraySegment`1)+24 
Microsoft.AspNet.SignalR.Hosting.ResponseExtensions.End(Microsoft.AspNet.SignalR.Hosting.IResponse, System.String)+c8 
Microsoft.AspNet.SignalR.PersistentConnection+d__f.MoveNext()+180 
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+285 
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+9 
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()+a4 
System_Web_ni!System.Web.Util.SynchronizationHelper.SafeWrapCallback(System.Action)+b4 
mscorlib_ni!System.Threading.Tasks.Task.Execute()+6e 
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+285 
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+9 
mscorlib_ni!System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)+250 
mscorlib_ni!System.Threading.Tasks.Task.ExecuteEntry(Boolean)+85 
mscorlib_ni!System.Threading.ThreadPoolWorkQueue.Dispatch()+1ea 
[[DebuggerU2MCatchHandlerFrame]] 
[[ContextTransitionFrame]] 
[[DebuggerU2MCatchHandlerFrame]]