【发布时间】:2019-09-06 15:55:43
【问题描述】:
我们在我们的一台服务器上遇到了一些间歇性问题,其中 api 出现间歇性 500 秒并出现以下错误,然后在我们重新启动 iis 或服务器之前一段时间后它一直在发生。这不会在本地 IIS 上发生。
[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.PipelineModuleStepContainer.GetStepArray(RequestNotification notification, Boolean isPostEvent) +30
System.Web.PipelineModuleStepContainer.GetEventCount(RequestNotification notification, Boolean isPostEvent) +8
System.Web.PipelineStepManager.ResumeSteps(Exception error) +1243
System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) +111
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +493
这发生在 IIS 7.5 上,并且应用程序是使用 .net 4.5 构建的。有时它对 2000 个请求运行正常,然后每隔几个请求就开始抛出 500 个请求。 我想知道这是否是 order 或 http 模块的问题,但我不知道为什么它只是有时会发生。
知道如何解决或解决此问题吗?
【问题讨论】:
-
好像是资源泄露,你是不是把所有用过的资源都处理掉了?
-
它可以在其他服务器上运行。相同的代码。我已经要求构建一个新的服务器(这是 UAT 环境),但我想了解它背后的原因。
-
很难猜到没有任何代码可以看。你有没有弄清楚哪个变量是空的,应该在哪一行代码设置它?这将是一个好的开始。
-
@JohnWu 我不确定哪个行或变量是 .net 内部库。我想知道这是否与 IIS 上的任何配置有关,因为它在其他服务器上运行良好。
标签: c# asp.net iis asp.net-web-api