1

My doubt is the following:

  • I have a page (aspx) which starts a new thread. I'm wonder to know what happens to the process of that thread if I undeploy the Application, or if I update the Application with a new version of the thread source code.

IIS wait the started thread to finish, throws a exception or just stop abruptly without exceptions?

Thank you

Marcelo Dias
  • 409
  • 2
  • 18

1 Answers1

1

If you redeploy the application with web.config the worker process used by your application pool will get recycled. Even if you change the web.config without deploying it'll restart (recycle) the worker process.

Worker process recycle means your application will restart again. It will wait for the running processes to complete.

But, if you just deploy your .aspx code it will not recycle the worker process.

Also read this at SO about worker process recycling.

Community
  • 1
  • 1
Sam
  • 2,917
  • 1
  • 15
  • 28
  • Note that you are mixing AppDomain recycle (performed by ASP.Net running in default AppDomin on web.config changes/DLL changes) with app pool recycle (performed by IIS based on time/usage or explicit restart/stop/start). Otherwise it is the same effect for managed thread - get killed by .Net runtime on AppDomain unload. – Alexei Levenkov Sep 18 '14 at 00:55
  • Sam, what you're telling me is that when a redeploy my entering app (web.config too) IIS will wait to my running threads to get the job done? Moreover, whether I replace my app DLL, without touching the web.config file, new threads of my old DLL might be started by IIS? – Marcelo Dias Sep 18 '14 at 23:40
  • @Alexei I should've said web.config change would indirectly recycle the app pool. Marcelo, Yes, your current running threads will complete but it'll not start any new threads from old DLLs (next postback will be served from the new assemblies). – Sam Sep 22 '14 at 03:01
  • You can't assume that your application will not get restarted if you just deploy one piece of code. there are various reasons for the application to get recycled. that's why we normally use a down time or a load balancing servers etc while deploying new code to live environments. – Sam Sep 22 '14 at 03:03
  • E.g. Global.asax file change will also recycle the app pool indirectly – Sam Sep 22 '14 at 03:04