【问题标题】:MassTransit NullReferenceException in ThreadPoolConsumerPoolThreadPoolConsumerPool 中的 MassTransit NullReferenceException
【发布时间】:2013-11-27 10:33:33
【问题描述】:

在 ASP.NET 中运行 MassTransit 时。根据此处报告的问题,正在抛出 NullReferenceExceptionGoogle Discussion Group

相关细节
有人知道如何在 AppDomain 重新加载时优雅地捕获异常吗?

堆栈跟踪仅到达 MassTransit DLL:

NullReferenceException in ThreadPoolConsumerPool

Locating source for 'd:\BuildAgent-03\work\8d1373c869590c5b\src\MassTransit\Threading\ThreadPoolConsumerPool.cs'. (No checksum.)
The file 'd:\BuildAgent-03\work\8d1373c869590c5b\src\MassTransit\Threading\ThreadPoolConsumerPool.cs' does not exist.
Looking in script documents for 'd:\BuildAgent-03\work\8d1373c869590c5b\src\MassTransit\Threading\ThreadPoolConsumerPool.cs'...
Looking in the projects for 'd:\BuildAgent-03\work\8d1373c869590c5b\src\MassTransit\Threading\ThreadPoolConsumerPool.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: d:\BuildAgent-03\work\8d1373c869590c5b\src\MassTransit\Threading\ThreadPoolConsumerPool.cs.
The debugger could not locate the source file 'd:\BuildAgent-03\work\8d1373c869590c5b\src\MassTransit\Threading\ThreadPoolConsumerPool.cs'.

【问题讨论】:

  • 您可能想在此处添加讨论的相关部分。仅链接的答案不适合该网站,我认为仅链接的问题不会好得多。
  • nvoigt - 我已经添加了相关细节
  • 这只是一个怀疑,但我认为 Mass Transit 会干扰 ASP.NET 用于处理请求的工作线程池。我们在使用异步委托从 ASP.NET 应用程序中调用 Web 服务时遇到了类似的问题 - 在高负载下,池最终耗尽并且性能很糟糕。它是在高负载下发生还是总是发生?
  • Wiktor - 这是在最小负载下的开发过程中

标签: c# asp.net masstransit


【解决方案1】:

您应该能够在 global.asax 中捕获任何未捕获的异常: http://msdn.microsoft.com/en-us/library/24395wz3(v=vs.100).aspx

实现错误处理程序:

void Application_Error(object sender, EventArgs e)

并将异常标记为已处理:

Server.ClearError();

【讨论】:

  • 如果你发布整个堆栈跟踪,也许它会显示异常发生在应用程序有机会连接错误处理程序之前。在这种情况下,您可以将 MT 初始化延迟到应用有机会设置之后。
  • 不,应用程序肯定已经通过了 application_start 并且每次发生这种情况时都运行了相当长的一段时间。
  • 可以在我原始问题中引用链接的屏幕截图中看到堆栈跟踪。
猜你喜欢
  • 1970-01-01
  • 2010-11-05
  • 2011-07-24
  • 2013-03-12
  • 2016-09-20
  • 2013-06-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多