当访问会话时,IE双回发会在集成管理管道模式下挂起IIS 7 [英] IE double postback hangs IIS 7 in Integrated Managed pipeline mode when session is accessed

查看:211
本文介绍了当访问会话时,IE双回发会在集成管理管道模式下挂起IIS 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的环境:$ 7 $ b Win7上的IIS7.5,.NET 4,应用程序池集成

Here's my environment: IIS7.5 on Win 7, .NET 4, App Pool Integrated

web.config

web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
</configuration>

Test.aspx

Test.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html>
<script runat="server">
    protected void OnAction(object sender, EventArgs e)
    {
        int count;
        status.Text = (int.TryParse(status.Text, out count) ? count + 1 : 0).ToString();

        Session["test"] = count;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>IIS Session Hang Test</title>
    <script>
        var mutiPostback = function () {
            var e = document.getElementById('LinkButton1');
            e.click();
            e.click();
        };
    </script>
</head>
<body>
    <form id="Form1" method="post" runat="server">
        <asp:ScriptManager runat="server" ID="SM">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="LinkButton1"/>
            </Triggers>
            <ContentTemplate>
                <asp:Label runat="server" ID="status" />
            </ContentTemplate>
        </asp:UpdatePanel>
        <input type="button" id="button1" onclick="mutiPostback();" value="MultiPostback"/>
        <div style="display: none">
            <asp:Button ID="LinkButton1" runat="server" OnClick="OnAction" Text="Click" />
        </div>
    </form>
</body>
</html>

是的,多次回发是故意的,我们注意到这种行为会导致许多请求卡在RequestAcquireState中并最终防止服务器接受任何新请求。但是,这个问题只能在IE下观察,而不能在Chrome或FF上观察。

Yes, the multiple postback is intentional, we notice this behavior will cause many request stuck in RequestAcquireState and ultimately prevent any new requests being accepted by the server. However, this problem is only observable under IE and not on Chrome or FF.

要测试,请不断点击多个回发按钮。这将更新状态编号。然后,当使用IE时,您将能够观察到该数字停止增加,表明请求卡住了问题。

To test, continuously clicking the multiple postback button. This will update the status number. You'll then be able to observe that number stop increasing when using IE, indicating the request stuck issue.

我能够通过以下IIS和IE版本产生此问题:

I was able to produce this issue with following IIS and IE versions:

在Windows Server 2008 R2上测试的IIS版本

IIS versions tested


  1. 7.5.7600.16385安装.Net 4.5的Windows 7 Pro上安装.Net 4.5

  2. 7.5.7600.16385

在Windows Server 2008上测试IE版本

IE version tested


  1. 9.0.8112.16421在Windows 7 Pro上

  2. 8.0.7600.16385 R2

  3. 6.0.3790.3959在Windows Server 2003 SP2上

我观察到的一个异常,是访问本地IIS时,Windows Server 2008 R2上的8.0.7600.16385不会导致此阻止问题。但是,如果我使用浏览器访问远程IIS,则可以重现该问题。在IE 9上,我可以重现这个问题,无论IIS是在远程还是本地。

An anomaly I observed, is that when accessing local IIS, 8.0.7600.16385 on Windows Server 2008 R2 does NOT cause this blocking issue. But if I use the browser to access a remote IIS, then the issue can be reproduced. While on IE 9 I can reproduce the issue regardless if IIS is on remote or local.

这是一个屏幕截图,显示挂起的请求在工作进程的请求列表中的样子。

Here's a screen shot of how the hanged request look like in request list for worker process.


现在我们我找到了几种方法来解决这个问题,但在我们的情况下没有一种方法可以接受:

Now we have found a few ways to get around this problem, but none are acceptable in our situation:


  1. 删除/注释会话使用情况。

  2. 将应用程序池更改为经典模式。

注意:我们还发现,即使我们不知道t直接使用Session如示例所示,问题仍然存在。 IE:如果我们添加一个Global.asax.cs并添加一个空的Session_Start事件处理程序,请求仍将在RequestAcquireState中挂起。

NOTE: we also found that even if we don't directly use Session as shown in the example, the problem still occurs. IE: if we add a Global.asax.cs and add an empty Session_Start event handler, the request will still hang in RequestAcquireState.

有没有人知道为什么这是发生了,我们如何解决这个问题,这个问题似乎只发生在集成管理管道模式中?

Does anyone have a clue why this is happening and how can we resolve this issue that only seem to happen in Integrated managed pipeline mode?

推荐答案

好消息!在安装.Net 4.5.1后,会话阻止问题似乎已经解决了。

Good news! It appears that the session blocking issue has been resolved after installing .Net 4.5.1

我已经在Windows Server 2008 R2上使用.Net升级了我的测试机器7.5.7600.16385 4.5安装到4.5.1并且问题消失了!

I've upgraded my testing machine 7.5.7600.16385 on Windows Server 2008 R2 with .Net 4.5 installed to 4.5.1 and the issue went away!

这篇关于当访问会话时,IE双回发会在集成管理管道模式下挂起IIS 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆