Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a site which holds an exclusive lock on some resources. I used the .NET Application_Start and Application_End events to aquire and release the lock on these resources at the appropriate time. For this to work properly, there can only ever be one instance of my application running at any given time.

To get this to happen, I've set the Disable Overlapped Recycle property on the Application pool to True. This property is supposed to ensure that the old worker process shuts down completley before a new one starts up whenever the app pool is recycled. This works fine whenever the app pool is recycled manually through IIS, automatically as the result of the idle-timeout being reached or automatially according to any specific time/time interval rules.

However, when the web.config for the site is updated, this rule isn't getting applied - A new worker process starts up before the old one finishes shutting down. This causes bad things to happen. I have the Disable Recycling for Configuration Changes property set to False as I do want the app pool to get recycled when the web.config is updated - this happens frequently during development.

Is this something which is expected, or is it a bug in IIS? IS my only option to set up so that changing the web.config doesn't recycle the app pool? I'd rather not do this, since I'm pretty sure it will cause many headaches with people changing the configuration and then forgetting to recycle the app pool.

Update:

To be more clear, when the new worker process 'start' event is called before the old worker process has finished shutting down, then the old worker process 'end' event never gets called - It doesn't happen out of sequence, it never happens at all.

share|improve this question
    
How long after the web.config is updated before the new worker process is started? –  Greg Askew Mar 7 '13 at 15:47
    
The new worker process starts as soon as I try to access the site after a recycle - So less than a second if I'm quick. If left, the old worker process 'shutdown' event takes places 20-30 seconds after the recycle. –  John Mar 7 '13 at 15:58
    
I have the same issue. There is overlap –  Andrew Rimmer May 1 at 12:43
    
Similar problem, but with "Disable Recycling for Configuration Changes". When I set this to true, when I change the web.config, my WCF ServiceHost closes. The w3wp process stays up, and my ServiceHost spins up again on the next client request. I assume that "Recycling" here means the application domain, not the application pool (process), but if so the configuration option on the app pool doesn't seem to have any effect at all. How can I prevent changes to configuration from "recycling" service hosts in this way? –  Wayne Jun 6 at 18:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.