<processModel shutdownTimeout... /> VS. <httpRuntime shutdownTimeout.../> VS application pool config

Last post 05-10-2008 6:39 AM by satalaj. 3 replies.

Sort Posts:

  • <processModel shutdownTimeout... /> VS. <httpRuntime shutdownTimeout.../> VS application pool config

    05-08-2008, 6:09 PM
    • Loading...
    • DrewTheRat
    • Joined on 05-22-2006, 8:33 PM
    • New Jersey
    • Posts 7

    Hello,

    Is there someone who can enlighten me on the use of the shutdownTimeout attributes of the processModel and httpRuntime elements? I've recently been chasing an issue with ThreadAbortExceptions related to bin/ updates, and I ended up increasing <httpRuntime shutdownTimeout.../>. I tried increasing <processModel shutdownTimeout... /> and the shutdown timeout in the application pool configuration, but neither of these worked. Only the shutdownTimeout in httpRuntime worked.

     There seems to be something different about them. At the very least, they're formatted differently (timespan vs. num seconds). I was psyched to see the httpRuntime setting fix things, but I still don't know why the other two didn't work. I'm wondering if they should have, and whether I really didn't fix my problem.

    Does anyone know the deal with these?

    Regards,

    Andrew

    -Drew

    "That's AC current for ya!"
  • Re: <processModel shutdownTimeout... /> VS. <httpRuntime shutdownTimeout.../> VS application pool config

    05-09-2008, 4:40 AM
    • Loading...
    • satalaj
    • Joined on 11-28-2007, 5:41 AM
    • Pune
    • Posts 502

    try
     {
       Response.Redirect(Http://www.asp.net);

     }

    Catch(Exception ex)

    {

    // you will get ThreadAbortExceptions

    }

    There are many reson to get that Exception

    You can get more help about process model here
    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/ee81b97b-b967-48f7-8ce9-1796a2e994fd.mspx?mfr=true

    Satalaj

  • Re: <processModel shutdownTimeout... /> VS. <httpRuntime shutdownTimeout.../> VS application pool config

    05-09-2008, 4:28 PM
    • Loading...
    • DrewTheRat
    • Joined on 05-22-2006, 8:33 PM
    • New Jersey
    • Posts 7

    Thanks Satalaj, I did know about the Response.Redirect/ThreadAbortException issue you mention. That is not the source of my exceptions. My application is updating its own bin/ folder, triggering an application restart. If my thread takes more than two minutes to complete (not unusual), it gets aborted.

    I actually read through the page you reference, as well as similar MSDN articles. Those led me to try changing the shutdownTimeout in processModel and in the application pool config. Neither of these worked - I still timed out at the 2 minute mark. Finally, I increased the shutdownTimeout in httpRuntime and that did work. I just don't know why it did.

    That's my question - why did the httpRuntime change work when the other two did not. What's the difference or is there a difference? Is there a precedence I'm not accounting for? Something like that....

    To test this, I created a simple page that updates a file in bin/ then sleeps for 3 minutes. Normally the page times out, but if I set <httpRuntime shutdownTimeout="240" ... /> in my web.config, the page runs to completion. Changing the other two shutdownTimeouts I mentioned did not yield this result.

    Following is the page I used to test this:


    <%@ Page Language="C#" AutoEventWireup="true" %>
    <%@ Import Namespace="System.IO" %>
    <%@ Import Namespace="System.Threading" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Sleep</title>
        <script language="C#" runat="server">
     
            protected void Page_Load(object sender, EventArgs e)
            {
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                lnkReset.NavigateUrl = Request.Url.ToString();
            }
            protected void cmdSleep_Click(object sender, EventArgs e)
            {
                // Amount of time to sleep after triggering the restart.
                int sleepSeconds = 180;
                // File to create/touch in bin folder to trigger restart
                string path = Server.MapPath("bin/sleep.txt"); 
                
                if (File.Exists(path))
                    File.SetLastWriteTime(path, DateTime.Now);
                else
                    File.Create(path).Close();
    
                Thread.Sleep(sleepSeconds * 1000); 
     
                cmdSleep.Visible = false;
                lnkReset.Visible = true;
            }
      </script> </head> <body> <form id="form1" runat="server"> <div> <asp:LinkButton ID="cmdSleep" runat="server" Text="Go" onclick="cmdSleep_Click" Visible="true"/> <asp:HyperLink ID="lnkReset" runat="server" Text="Reset" Visible="false" /> </div> </form> </body> </html

    -Drew

    "That's AC current for ya!"
  • Re: <processModel shutdownTimeout... /> VS. <httpRuntime shutdownTimeout.../> VS application pool config

    05-10-2008, 6:39 AM
    • Loading...
    • satalaj
    • Joined on 11-28-2007, 5:41 AM
    • Pune
    • Posts 502

    Hi Drew thanks for throwing light here. I will produce the same error at my end then we will find the answer.

Page 1 of 1 (4 items)