20

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

web.config

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

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>

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.

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.

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

IIS versions tested

  1. 7.5.7600.16385 on Windows Server 2008 R2 with .Net 4.5 Installed
  2. 7.5.7600.16385 on Windows 7 Pro with .Net 4.5 Installed

IE version tested

  1. 9.0.8112.16421 on Windows 7 Pro
  2. 8.0.7600.16385 on Windows Server 2008 R2
  3. 6.0.3790.3959 on Windows Server 2003 SP2

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.

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

  1. Remove/Comment out Session usage.
  2. Change app pool to Classic mode.

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?

4

4 に答える 4

8

あなたの説明から、要求のセッション オブジェクトを取得しようとすると IIS デッドロックのように見えます。これはサーバー側の問題にすぎないため、ブラウザーで理由を探すつもりはありません。そして、おそらくあなたができることはあまりありません。デッドロックの場合は、マルチスレッドのタイミング依存の問題です。したがって、異なるブラウザがわずかに異なるタイミングでリクエストを送信すると、異なる結果が得られます。また、ブラウザをローカルまたはリモートで実行すると、タイミングがわずかに異なります。問題はセッションの取得にあるため、セッションを空にしても役に立ちません。セッションはまったく取得されないため、セッションを完全に無効にすると役立ちます。AppPool をクラシックに変更すると、デッドロックのないセッション管理の実装が異なるため、役立ちます。仮説を検証するには、クライアント側のポストバック間に人為的な遅延を挿入してみることができます。これにより、異なるタイミング条件が作成され、問題に影響するはずです。

これらは、あなたの説明と IIS での私の経験に基づく憶測に過ぎないと言わざるを得ません。パフォーマンスのマイナス面はそれほど大きくないため、AppPool を Classic に変更することをお勧めします。

于 2013-03-01T07:00:52.377 に答える
1

これは Stackoverflow の投稿と同じであることに注意してください --> AJAX POST の ManagedPipelineHandler は、呼び出しの進行中に IE9 ユーザーがページから移動するとクラッシュします

これは、ASP.NET 4.5 での回帰のようです。ASP.NET チームはパッチに取り組んでいますが、一時的な回避策があります (上記の投稿を参照してください)。

公開されている広範な更新を待つことができない場合は、Microsoft カスタマー サポートに連絡して、修正プログラムの要求を求めることができます。サポートケースを開く通常のプロセスに従ってください。たとえば、オンラインでファイルhttps://support.microsoft.com/oas/default.aspx?&gprid=548&&st=1&wfxredirect=1&sd=gnまたはサポートに電話http://support.microsoft.com/default.aspx?id=fh ;en-us;offerprophone . 最小限の前払いが必要になる場合がありますが、カスタマー サポート ポリシーに基づいて返金される場合があります。カスタマー サポートの専門家に、Microsoft ドットコムの netfx45compat に連絡して、この問題に関する簡単なコンテキストを取得するよう依頼してください。

ありがとう Varun Gupta (.NET Framework 互換性)

于 2013-04-14T23:22:42.537 に答える