468,283 Members | 1,936 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,283 developers. It's quick & easy.

detect when an app domain is being shut down

Hi,

We have HttpHandlers that can process requests for up to 50 minutes. Those
HttpHandlers are running in an app domain inside the DefaultAppPool. We'd
like the HttpHandlers to be able to detect when its containing app pool or
app domain is requesting a shutdown (when it is recycling, for example). I
looked at the Application_End method in global.asax, as well as the System.
AppDomain.CurrentDomain.DomainUnload event. Neither get called as long as
the HttpHandlers are handling a client request. Is there a way to
programatically know when an app domain is about to shut down? We need to
know so that we can force the request to end more quickly and gracefully.

Thanks for you help.

Bubba
Dec 11 '06 #1
5 4044
Hi,
I think this can be handled inside AppDomain.UnhandledException event.
If you want complete working code for it then please let me know.

Thanks and Regards,
mansih bafna

"Bubba" wrote:
Hi,

We have HttpHandlers that can process requests for up to 50 minutes. Those
HttpHandlers are running in an app domain inside the DefaultAppPool. We'd
like the HttpHandlers to be able to detect when its containing app pool or
app domain is requesting a shutdown (when it is recycling, for example). I
looked at the Application_End method in global.asax, as well as the System.
AppDomain.CurrentDomain.DomainUnload event. Neither get called as long as
the HttpHandlers are handling a client request. Is there a way to
programatically know when an app domain is about to shut down? We need to
know so that we can force the request to end more quickly and gracefully.

Thanks for you help.

Bubba
Dec 12 '06 #2
Hi,
Have you also tried AppDomain.ProcessExit?

Thanks and Regards,
manish bafna

"Bubba" wrote:
Hi,

We have HttpHandlers that can process requests for up to 50 minutes. Those
HttpHandlers are running in an app domain inside the DefaultAppPool. We'd
like the HttpHandlers to be able to detect when its containing app pool or
app domain is requesting a shutdown (when it is recycling, for example). I
looked at the Application_End method in global.asax, as well as the System.
AppDomain.CurrentDomain.DomainUnload event. Neither get called as long as
the HttpHandlers are handling a client request. Is there a way to
programatically know when an app domain is about to shut down? We need to
know so that we can force the request to end more quickly and gracefully.

Thanks for you help.

Bubba
Dec 12 '06 #3
Hi Manish,

Thanks for your input, but AppDomain.ProcessExit is not called while there
are requests running. Also, AppDomain.UnHandledException is not appropriate
because there are no exceptions thrown in this case.

Thanks,
Bubba
Dec 12 '06 #4
Since your http handlers are still executing you AppDomain will not shut
down so could you hook into any shutdown event?

Gabriel

"Bubba" <fa**@fake.fakewrote in message
news:f9******************************@ureader.com. ..
Hi,

We have HttpHandlers that can process requests for up to 50 minutes.
Those
HttpHandlers are running in an app domain inside the DefaultAppPool. We'd
like the HttpHandlers to be able to detect when its containing app pool or
app domain is requesting a shutdown (when it is recycling, for example).
I
looked at the Application_End method in global.asax, as well as the
System.
AppDomain.CurrentDomain.DomainUnload event. Neither get called as long as
the HttpHandlers are handling a client request. Is there a way to
programatically know when an app domain is about to shut down? We need to
know so that we can force the request to end more quickly and gracefully.

Thanks for you help.

Bubba

Dec 12 '06 #5
In essence, that is what I want to do - but I don't know where to do that.

Bubba
Dec 12 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Claire | last post: by
2 posts views Thread by Mike Stephens | last post: by
3 posts views Thread by BrianDH | last post: by
7 posts views Thread by mangesh | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.