S
splap20
Every day a large chunk of XML is posted up to my app via http. The app
interprets this XML and writes results to a SQLServer. Occasionally a
ThreadAbortException is thrown during this process. Despite being
caught, this exception propagates all the way up the call stack. I know
this is by design and that I can use Thread.ResetAbort to stop this
exception from bubbling up the stack.
But I want to know why the exception is thrown in the first place.
My app is not multithreaded, and I never call Thread.Abort directly.
Maybe something I am doing causes it to be called but I don't know
what that could be.
I know that Response.Redirect and Response.End throw a
ThreadAbortException, but I do not use either of those. Instead I use
HttpContext.Current.ApplicationInstance.CompleteRequest() which I
presume also throws a ThreadAbortException. But since this is only
called when the job is complete, I do not see how this could be a
problem.
At this point I am guessing that a setting in my machine.config or
web.config is telling IIS to kill my process from some reason. I have
set machine.config's httpRuntime attributes executionTimeout and
maxRequestLength to 2 hours (way longer than the job takes) and 1gig
(way bigger than the posted xml) respectively.
Any ideas how to figure out why I am getting this ThreadAbortException?
interprets this XML and writes results to a SQLServer. Occasionally a
ThreadAbortException is thrown during this process. Despite being
caught, this exception propagates all the way up the call stack. I know
this is by design and that I can use Thread.ResetAbort to stop this
exception from bubbling up the stack.
But I want to know why the exception is thrown in the first place.
My app is not multithreaded, and I never call Thread.Abort directly.
Maybe something I am doing causes it to be called but I don't know
what that could be.
I know that Response.Redirect and Response.End throw a
ThreadAbortException, but I do not use either of those. Instead I use
HttpContext.Current.ApplicationInstance.CompleteRequest() which I
presume also throws a ThreadAbortException. But since this is only
called when the job is complete, I do not see how this could be a
problem.
At this point I am guessing that a setting in my machine.config or
web.config is telling IIS to kill my process from some reason. I have
set machine.config's httpRuntime attributes executionTimeout and
maxRequestLength to 2 hours (way longer than the job takes) and 1gig
(way bigger than the posted xml) respectively.
Any ideas how to figure out why I am getting this ThreadAbortException?