[Mono-dev] Asp.net thread abort issue

Joshua Tauberer tauberer at for.net
Sat Oct 8 10:53:41 EDT 2005

Gonzalo (and anyone else that might have some ideas, but probably Gonzalo),

I'm experiencing something funny on my website.  I think it started 
after upgrading to the latest RPMs (FC4).  It goes something like this:

A request is made for page X.  During the processing of the page (which 
is handled by a custom HttpHandler), HttpResponse.Redirect is called to 
send the user to page Y.  (This is properly calling Thread.Abort, 
issuing a ThreadAbortException, and the request nicely comes to an end.)

The user then requests page Y.  Deep in the processing of this page 
(custom HttpHandler to System.Xml.Xslt which uses extension functions 
which calls back to my code), a ThreadAbortException is mysteriously 
being thrown.  The result is the request ends with no content being sent 
to the user.  The stack trace shows the exception being thrown in the 
middle of one of my methods, which for sure doesn't throw that exception 
and doesn't call Response.Redirect.

I don't know how Thread.Abort works, but my guess is that some flag is 
being set the first time Thread.Abort is called within 
Response.Redirect, and that's leading to Thread.Abort being thrown a 
second time later on.  But I can only imagine this happening if in the 
ASP.NET hosting area of things a worker thread is catching the 
ThreadAbortException, tossing it away, and then handling another request.

I'll keep poking around to see if I can figure this out, but you might 
already know where to look.


- Joshua Tauberer


** Nothing Unreal Exists **

More information about the Mono-devel-list mailing list