What causes 'Thread was being aborted' error

H

HLady

I have been googling and cannot seem to find the answer I seek so I
turn to the group.
I have an application where I have been receiving 'Thread was being
aborted' error ocasionally. In production I have received it at least 3
times in 45 days. It is sporadic.

After some searching, I can rule out the most likely suspects. It is
NOT happening because of a Reponse.Redirect, which seems to be the most
common in the posts I have seen. I thought it might have to do with the
system resources and recycling, but I have not seen anything in the
event viewer referring to that.

Does anyone have any sugestions on how to start diagnosing this issue.
Are there other reasons that could be causing this. Can anyone direct
me to a better source of reasons that could cause this error. Thanks
 
M

Mr Newbie

Perhaps this is as a result of a Session timeout at the same time as a
postback ?
 
J

JIMCO Software

HLady said:
I have been googling and cannot seem to find the answer I seek so I
turn to the group.
I have an application where I have been receiving 'Thread was being
aborted' error ocasionally. In production I have received it at least
3 times in 45 days. It is sporadic.

After some searching, I can rule out the most likely suspects. It is
NOT happening because of a Reponse.Redirect, which seems to be the
most common in the posts I have seen. I thought it might have to do
with the system resources and recycling, but I have not seen anything
in the event viewer referring to that.

Does anyone have any sugestions on how to start diagnosing this issue.
Are there other reasons that could be causing this. Can anyone direct
me to a better source of reasons that could cause this error. Thanks

You can attach a debugger like CDB to the process and configure it to dump
the process when the ThreadAbortException occurs. You can then use the dump
to analyze the stack. Come to think of it, you could just have CDB dump the
stack when this happens.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003
 
S

S. Justin Gengo

HLady,

Most of the time this is caused by a Response.Redirect being used inside of
a Try Catch.

To stop this from happening there is an additional parameter that may be
passed into the try catch, "EndResponse". EndResponse is set to true by
default, but ending the response while in a try catch causes the error
you're seeing. Setting EndResponse to false will solve the problem. Use it
like this:

Response.Redirect("MyNewPage.aspx", False)

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
H

HLady

I had read it was caused by a response.redirect most of the time, but
unfortunately that is not the case here. Thanks for your suggestion.
 
B

Bruce Barker

Response.End() aborts the current thread (it called by Reponse.Redirect).
this should be the only "normal" condition. asp.net monitoring will also
kill a thread if it runs too long, (past timeout). this is the most likely
in your low volume case.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top