2

We have an application that can create e-books. This application has an export module that creates an AIR file but this can take a while (some books have 2500 pages). If we export we get the following error:

Thread was being aborted. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Threading.ThreadAbortException: Thread was being aborted.

Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 

[ThreadAbortException: Thread was being aborted.]
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +501
   System.Web.ApplicationStepManager.ResumeSteps(Exception error) +564
   System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +141
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +436

I've changed my runtime executiontimeout to 3600 secs but it keeps crashing arround 3 minutes. so it is time related ... everytime we approach the 3 minutes it crashes, I hope someone can help me out.

4

3 回答 3

4

I think Paul is right about the cause of the exception. Both IIS and ASP.NET have settings that limit the maximum amount of time a request can take. For ASP.NET it's in the Machine.Config file (look for the httpRuntime element, executionTimeout attribute). It's set to 90 seconds on my development machine.

I would however not advise you to change that setting as it's there to make sure your application doesn't hang on a bad request.

Long running tasks should use asynchronous execution. With async execution, the actual work is handled on a separate thread. This frees the thread that handles the request to handle other requests which is good for the overall performance of your application.

There are some good articles on this available. For example : http://msdn.microsoft.com/en-us/magazine/cc163725.aspx

于 2009-05-05T14:45:54.193 回答
0

Quite often, this error actually occurs from an OutOfMemory exception. Is there an InnerException available?

于 2009-04-30T10:04:39.123 回答
0

IIS has a 'run-away' thread protection that will kill a thread/appdomain if it runs for too long.

于 2009-04-30T10:07:10.567 回答