Previous Next

Thread: Application Pool Recycling but not releasing locks...

Last post 05-21-2008 3:37 PM by mshabib. 6 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 05-12-2008, 5:50 PM

    • mshabib
    • Top 500 Contributor
    • Joined on 11-27-2007, 12:37 PM
    • Posts 14
    • mshabib

    Application Pool Recycling but not releasing locks...

    Hey All

     

    A tool we use programmatically creates/updates ASP.NET 2.0 websites and each website is in its own Application Pool, this is all done via C# and DirectoryServices. When I create the website for the first time, I check to see if the related appPool needs to be created and do so if needed, if not, then I just recycle the application pool and regenerate my website DLLs in the bin directory. My problem is that even after recycling the application pool, my website's generated DLLs cannot get copied into the BIN directory as the old lock still exists on the old DLL files. If I wait a long time (couple of minutes), everything seems to work. In an earlier iteration of our code, we generated all websites within the DefaultAppPool application pool and never had any problems with locked files. Any ideas?

     

    Thanks

    Mustafa     

     

  • 05-12-2008, 8:12 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 988
    • anilr

    Re: Application Pool Recycling but not releasing locks...

    What kind of dlls are these?  native modules/ISAPI extensions/ISAPI filters/managed assmeblies/COM dlls etc?  You can use process explorer from sysinternals to figure out which process has handles to these dlls opened.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 05-12-2008, 9:20 PM In reply to

    • mshabib
    • Top 500 Contributor
    • Joined on 11-27-2007, 12:37 PM
    • Posts 14
    • mshabib

    Re: Application Pool Recycling but not releasing locks...

    hey these are support assemblies (managed) used by the generated website that im trying to replace. the process w3wp.exe has a handle on them even though ive recycled the related app pool. thanks mustafa
  • 05-13-2008, 10:47 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 988
    • anilr

    Re: Application Pool Recycling but not releasing locks...

    So your problem is that your old worker processes are not going away for a while when you recycle your app-pool?  This would normally mean that some request is taking a while to finish (or even never finishing) - this could be caused by any code within the worker process (including possibly your code) - you will need to debug the worker process at the point when you have issued a recycle but it is still not going away - and get product support involved if you cannot debug it yourselves.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 05-13-2008, 11:06 AM In reply to

    • mshabib
    • Top 500 Contributor
    • Joined on 11-27-2007, 12:37 PM
    • Posts 14
    • mshabib

    Re: Application Pool Recycling but not releasing locks...

    yeah unfortunately, i know for a fact that there are no pending requests. if i stop the application pool instead of recycle it, will it release locked files?  

  • 05-13-2008, 11:55 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 988
    • anilr

    Re: Application Pool Recycling but not releasing locks...

    Since we do not know what code in the worker process is causing it to not exit on app-pool recycle, there is no way to tell if that code will allow the worker process to exit on app-pool shutdown.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 05-21-2008, 3:37 PM In reply to

    • mshabib
    • Top 500 Contributor
    • Joined on 11-27-2007, 12:37 PM
    • Posts 14
    • mshabib

    Re: Application Pool Recycling but not releasing locks...

    Hello again everyone,

    I've gone so far as to actually delete the websites in question as well as their related app pool and I still cannot overwrite the assemblies in my website's BIN directory. I'm really hitting a wall here; any tips to solve my problem are very much appreciated.

     

    Thanks.     

Page 1 of 1 (7 items)
Page view counter