IIS7 挂在模块 WindowsAuthentication 中的 AuthenticateRequest 状态

发布于 2024-07-27 01:58:39 字数 456 浏览 1 评论 0原文

我正在运行一个 ASP.NET 应用程序,其中包含在 IIS7 下注册的自定义模块。

直到两天前,一切都运行良好。 现在我注意到请求开始在 AuthenticateRequest 状态和 WindowsAuthentication 模块中挂起。 我的自定义模块在 BeginRequest 状态拦截并处理请求,并使用 HttpContext.Current.ApplicationInstance.CompleteRequest() 完成请求处理。 它不处理的请求将留给 IIS 通过其他模块进行处理。

问题(请求挂起)发生在我的自定义模块不处理的页面中。

我应该从哪里开始解决这个问题有什么想法吗? 我今天在三台不同的机器上不断重现这个问题。 我还发现我们上个月没有更改 web.config 文件。

非常感谢任何解决此问题的帮助。

提前致谢, 查尔斯·普拉卡什·达萨里

I am running an ASP.NET application with a custom module registered under IIS7.

Until two days back, everything was running fine. Now I notice that the requests started to hang at the AuthenticateRequest state and in the WindowsAuthentication module. My custom module intercepts at the BeginRequest state and processes the requests and completes the request processing using HttpContext.Current.ApplicationInstance.CompleteRequest(). The requests that it doesn't process are left for IIS to take them through the other modules for processing.

The problem (the request hang) occurs in pages that my custom module doesn't process.

Any ideas where I should start troubleshooting this problem? I have consistently reproduced this problem on three different machines today. I also found that we did not change our web.config file in the last month.

Any help towards troubleshooting this problem is greatly appreciated.

Thanks in advance,
Charles Prakash Dasari

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小…楫夜泊 2024-08-03 01:58:39

最后我找到了解决我的问题的方法。

我实现的自定义模块使用异步处理程序:

        context.AddOnBeginRequestAsync(
            new BeginEventHandler(BeginBeginRequest),
            new EndEventHandler(EndBeginRequest)
        );

在我的模块不处理请求的情况下,开始事件处理程序将完成请求并且不执行任何操作。 直到几天前,我还在 Begin 方法中跳到另一个线程来处理这些请求,最近我修复了它,只有当我的模块必须处理请求时,我才跳到另一个线程。 现在这导致了问题。 显然 IIS 不喜欢我在同一个线程中完成处理。

所以现在我再次跳到另一个线程 - 无论如何。 IIS 很高兴,我的应用程序不再挂起。

我仍然需要进一步调查并确定为什么会发生这种情况 - 或者它是否确实是 IIS 中的错误或我从 BeginBeginRequest 方法返回 IAsyncResult 的方式中的错误。 但现在我知道我必须在不同的线程上处理这个请求。

Finally I found the solution to my problem.

The custom module I have implemented uses async handlers:

        context.AddOnBeginRequestAsync(
            new BeginEventHandler(BeginBeginRequest),
            new EndEventHandler(EndBeginRequest)
        );

In the case where my module do not process the request, the begin event handler completes the request and has nothing to do in it. Up until a couple of days ago, I was jumping off to another thread to process these requests in the Begin method and recently I fixed it such a way that I jump off to another thread only if my module has to process the request. Now this has caused the problem. Apparently IIS is not liking that I am completing my processing in the same thread.

So now I jump off to another thread again - no matter what. IIS is happy and my app is not hanging any more.

I still have to investigate further and make sure why this happens - or if it is a bug really in IIS or in the way I return the IAsyncResult from BeginBeginRequest method. But for now I know that I have to process this request on a different thread.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文