Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6377655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:54:07+00:00 2026-05-25T01:54:07+00:00

I’m seeing this on our production site as well as a small test site

  • 0

I’m seeing this on our production site as well as a small test site I setup just to test this out…

Basically, it appears that requests handled by mvc never time out. I’ve set an executionTimeout in my web.config and turned off debug mode. I’ve then added an infinite loop of thread.sleeps to both a regular aspx page and an mvc page (the loop is in the controller of the mvc page). The aspx page reliably times out (HttpException (0x80004005): Request timed out.), but the mvc page just spins forever without timing out.

Are there separate settings for mvc (I’ve looked but haven’t found them)? Do mvc requests not timeout by default?

Any help on this would be appreciated. I’ll gladly email out my small test site if it would help anyone out.

Edit: I’m using MVC3.

Contents of my web.config:

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
  <connectionStrings>
    <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
    <add key="webpages:Enabled" value="true" />
  </appSettings>

  <system.web>
      <httpRuntime maxRequestLength="16384" executionTimeout="30" />
      <compilation debug="false" targetFramework="4.0">
          <assemblies>
          <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          </assemblies>
      </compilation>

    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
    </authentication>

    <membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="/" />
      </providers>
    </membership>

    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
      </providers>
    </profile>

    <roleManager enabled="false">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>

  </system.web>

  <system.webServer>
     <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:54:09+00:00Added an answer on May 25, 2026 at 1:54 am

    I found the cause for this, methinks:

    This method is in the WrappedAsyncResult class, which the MvcHandler class uses via BeginProcessRequest:

    public static IAsyncResult BeginSynchronous<TResult>(AsyncCallback callback, object state, Func<TResult> func, object tag)
    {
        BeginInvokeDelegate beginDelegate = delegate (AsyncCallback asyncCallback, object asyncState) {
            SimpleAsyncResult result = new SimpleAsyncResult(asyncState);
            result.MarkCompleted(true, asyncCallback);
            return result;
        };
        EndInvokeDelegate<TResult> endDelegate = _ => func();
        WrappedAsyncResult<TResult> result = new WrappedAsyncResult<TResult>(beginDelegate, endDelegate, tag);
        result.Begin(callback, state, -1);
        return result;
    }
    

    where “Begin” is:

    public void Begin(AsyncCallback callback, object state, int timeout)
    {
        bool completedSynchronously;
        this._originalCallback = callback;
        lock (this._beginDelegateLockObj)
        {
            this._innerAsyncResult = this._beginDelegate(new AsyncCallback(this.HandleAsynchronousCompletion), state);
            completedSynchronously = this._innerAsyncResult.CompletedSynchronously;
            if (!completedSynchronously && (timeout > -1))
            {
                this.CreateTimer(timeout);
            }
        }
        if (completedSynchronously && (callback != null))
        {
            callback(this);
        }
    }
    

    EDIT: have come up with a ham-handed way of forcing MVC controller actions to “time out”, although the mechanism is a bit brutish:

    public class TimeoutController : Controller
    {
        private bool _isExecuting = false;
        private int _controllerTimeout = 5000;
        private Thread _executingThread;
        private readonly object _syncRoot = new object();
    
        protected override void ExecuteCore()
        {
            _executingThread = Thread.CurrentThread;
            ThreadPool.QueueUserWorkItem(o =>
                {
                    Thread.Sleep(_controllerTimeout);
                    if (_isExecuting)
                    {
                        _executingThread.Abort();
                    }
                });
            base.ExecuteCore();
        }
    
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            _isExecuting = true;
            base.OnActionExecuting(filterContext);
        }
    
        protected override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            _isExecuting = false;                
            base.OnActionExecuted(filterContext);
        }
    
        public int ControllerTimeout
        {
            get
            {
                int retVal;
                lock(_syncRoot)
                {
                    retVal = _controllerTimeout;
                }
                return retVal;
            }
            set
            {
                lock(_syncRoot)
                {
                    _controllerTimeout = value;                    
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.