424,054 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,054 IT Pros & Developers. It's quick & easy.

detect when an app domain is being shut down

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.