H
Howard Hoffman
We have an ASP.NET application that makes heavy use of the
System.Threading.ThreadPool for background work. We use the Global.asax
Application_End end to set a ManualResetEvent that tells the threads to
cease work. However, if they are very busy it can take as long as 10
minutes for all of them to end.
During a period where the threads were indeed very busy, an engineer:
1) Made a change to web.config for the application. Saved the file.
2) Immediately surfed to one of the application's web pages.
There was a delay of about 10 seconds in bringing the page up on step
2...and the machine restarted itself.
Stunned, we tried it again an hour later and got the same result.
There was no dump file, and nothing in the Windows Event Log other than the
'starting Windows' parade of events. We also noted that our application log
file had an entry for Application_End, and appeared to end normally (except
the background threads never reported back that they finished ...).
What are the expected restart semantics here? I know that saving
web.config triggers an application-end, which really equates to the
AppDomain shutting down. I'd thought, however, that any in-flight HTTP
requests or background threads would continue to work in the to-be-ended
AppDomain, and that once all that work was finished the AppDomain would
indeed go away. At the same time a new AppDomain is created to be used for
new HTTP requests and anything else that is done in the application
following the Application_Start event.
Has this changed for W2K8, or am is my understanding of application-restart
semantics incorrect.
This machine does have a post W2K8 SP1 / ASP.NET 2.0/3.5 SP1 hotfix :
967535.
Any ideas or clarifications greatly appreciated.
Howard Hoffman
System.Threading.ThreadPool for background work. We use the Global.asax
Application_End end to set a ManualResetEvent that tells the threads to
cease work. However, if they are very busy it can take as long as 10
minutes for all of them to end.
During a period where the threads were indeed very busy, an engineer:
1) Made a change to web.config for the application. Saved the file.
2) Immediately surfed to one of the application's web pages.
There was a delay of about 10 seconds in bringing the page up on step
2...and the machine restarted itself.
Stunned, we tried it again an hour later and got the same result.
There was no dump file, and nothing in the Windows Event Log other than the
'starting Windows' parade of events. We also noted that our application log
file had an entry for Application_End, and appeared to end normally (except
the background threads never reported back that they finished ...).
What are the expected restart semantics here? I know that saving
web.config triggers an application-end, which really equates to the
AppDomain shutting down. I'd thought, however, that any in-flight HTTP
requests or background threads would continue to work in the to-be-ended
AppDomain, and that once all that work was finished the AppDomain would
indeed go away. At the same time a new AppDomain is created to be used for
new HTTP requests and anything else that is done in the application
following the Application_Start event.
Has this changed for W2K8, or am is my understanding of application-restart
semantics incorrect.
This machine does have a post W2K8 SP1 / ASP.NET 2.0/3.5 SP1 hotfix :
967535.
Any ideas or clarifications greatly appreciated.
Howard Hoffman