Showing posts with label abort. Show all posts
Showing posts with label abort. Show all posts

Thursday, March 22, 2012

Thread abort error - REVISITED

I'm periodically getting "Thread Abort Error" errors thown from my web
app. My app will throw like 5 of these and will work normally again.
I'm thinking it is because my worker process was recycling so it
aborted all the threads. My question is, How can I stop it?Don't put any code after Response.Redirect(). That's it. Those Thread
Abort Exceptions will go away.

If you have so much as a return statement after a
Response.Redirect(?,true);, you'll run the risk of seeing these
exceptions. Regardless of what you do, you shouldn't be sweating them.
They're completely harmless.

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

--
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Thread abort error - REVISITED

I'm periodically getting "Thread Abort Error" errors thown from my web
app. My app will throw like 5 of these and will work normally again.
I'm thinking it is because my worker process was recycling so it
aborted all the threads. My question is, How can I stop it?Don't put any code after Response.Redirect(). That's it. Those Thread
Abort Exceptions will go away.
If you have so much as a return statement after a
Response.Redirect(?,true);, you'll run the risk of seeing these
exceptions. Regardless of what you do, you shouldn't be sweating them.
They're completely harmless.
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Thread Abort?

I need to have an asynch thread abort itself. Something akin to a STOP. The
thread that spawned it cannot access it so it must done within the thread.

ChipBest way is probably to have a field visible to the thread thats not
controlled by the async thread and have the asyn thread check if the value
signifies abort. Perhaps a value available in Context, session or
application that the async thread can periodically look at.

Regards

John Timney (MVP)

http://www.johntimney.com
"Chip" <chip@.intradata.comwrote in message
news:%230tC6q21GHA.1268@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

>I need to have an asynch thread abort itself. Something akin to a STOP. The
>thread that spawned it cannot access it so it must done within the thread.
>
Chip
>


This approach has the parent process ending the thread. The test is in the
thread itself so it needed to be a self-abort. There doesn't seem to be a
good way to do it based on what I've been able to research, so since the
easy way out is not there, I restructured the code so I could just use "exit
sub".

Thanks for the reply,

Chip

"John Timney (MVP)" <x_john@.timney.eclipse.co.ukwrote in message
news:ILWdnbZUP7x495XYRVny1Q@.eclipse.net.uk...

Quote:

Originally Posted by

Best way is probably to have a field visible to the thread thats not
controlled by the async thread and have the asyn thread check if the value
signifies abort. Perhaps a value available in Context, session or
application that the async thread can periodically look at.
>
Regards
>
John Timney (MVP)
>
>
http://www.johntimney.com
"Chip" <chip@.intradata.comwrote in message
news:%230tC6q21GHA.1268@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

>>I need to have an asynch thread abort itself. Something akin to a STOP.
>>The thread that spawned it cannot access it so it must done within the
>>thread.
>>
>Chip
>>


>
>


If you abort an asnc thread with something like thread abort I believe it
throws an unhandled exception, which can leave your objects in an ustable
state, hence my suggestion to use a controller value to terminate and exit
the thread cleanly. If you've managed to get it running to exit sub and die
cleanly then stick with it.

Regards

John Timney (MVP)
http://www.johntimney.com
"Chip" <chip@.intradata.comwrote in message
news:%233CJhy31GHA.4392@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

This approach has the parent process ending the thread. The test is in the
thread itself so it needed to be a self-abort. There doesn't seem to be a
good way to do it based on what I've been able to research, so since the
easy way out is not there, I restructured the code so I could just use
"exit sub".
>
Thanks for the reply,
>
Chip
>
>
"John Timney (MVP)" <x_john@.timney.eclipse.co.ukwrote in message
news:ILWdnbZUP7x495XYRVny1Q@.eclipse.net.uk...

Quote:

Originally Posted by

>Best way is probably to have a field visible to the thread thats not
>controlled by the async thread and have the asyn thread check if the
>value signifies abort. Perhaps a value available in Context, session or
>application that the async thread can periodically look at.
>>
>Regards
>>
>John Timney (MVP)
>>
>>
>http://www.johntimney.com
>"Chip" <chip@.intradata.comwrote in message
>news:%230tC6q21GHA.1268@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

>>>I need to have an asynch thread abort itself. Something akin to a STOP.
>>>The thread that spawned it cannot access it so it must done within the
>>>thread.
>>>
>>Chip
>>>


>>
>>


>
>