Thread is being aborted

2019-08-29 02:20发布

What exactly does all this mean below. I am running an asynchronous web request that calls a page that sends code to my database. Then my database fires off a stored procedure that runs into one of my SQL assemblies. Most times it works, but sometimes I get this:

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) +486
    System.Web.ApplicationStepManager.ResumeSteps(Exception error) +501
    System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +123
    System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +379

2条回答
淡お忘
2楼-- · 2019-08-29 03:01

The app domain could be getting recycled which can happen for a number of reasons. That can cause a thread abort exception.

Here is an article which explains some of the reasons for a recycle

If a process is long running, IIS/ASP.Net is not usually a good place to run it.

查看更多
The star\"
3楼-- · 2019-08-29 03:12

The reason why you are getting this error most likely is that you are getting timed out. Increase the ExecutionTimeout since at default its 110 seconds.

<compilation debug="false"></compilation>
<httpRuntime executionTimeout="1800"/> //1800 seconds / 30 minutes. 

Here's an article that goes more into detail as to how to increase the ExecutionTimeout.

查看更多
登录 后发表回答