开发者

What are possible causes for App_Offline.htm not bringing the site down?

开发者 https://www.devze.com 2023-01-13 03:54 出处:网络
Normally, I use App_Offline.htm for taking the site offline. But occasionally, when I do that, the site just hangs (like in: browsers wait forever, server 开发者_JAVA百科gives no response at all). Thi

Normally, I use App_Offline.htm for taking the site offline. But occasionally, when I do that, the site just hangs (like in: browsers wait forever, server 开发者_JAVA百科gives no response at all). This seems to happen on an updateable site when I change something, like a control and afterward, when it doesn't go quick enough (site hangs), I place App_Offline.htm in the root of the website.

In most cases, this immediately takes down my site. But occasionally it doesn't. In those cases, I cannot just stop the website (when I restart, the behavior continues). Stopping the application pool doesn't let me restart the same app pool. The only two solution so far is restarting the whole IIS web service.

I'd like to prevent this from happening. Is this a bug in IIS not "breaking all actions" when App_Offline.htm is found? I use IIS 7 with Windows 2008 SP2 64 bit.


What I found was that my web.config file either had an error in it or was missing. When this is the case, app_offline.htm does not get processed.


IIS should not stop existing actions, only prevent new requests from going through: Will app_offline.htm stop current requests or just new requests?

It sounds like you are describing a scenario where you update a control, try to load a page, and IE is stuck loading. At this point you drop the app_offline.htm and expect to see that page immediately.

If you are making a completely separate/new request after putting app_offline.htm in place then you should see the page come up. However the existing request will not be affected as linked above.

If possible try deploying the app_offline.htm file prior to making the control change.


I am not sure what you mean by "Stopping the application pool doesn't let me restart the same app pool"...if you meant that you can't restart the pool immediately after stopping it, thats because it isn't stopped yet. Depending on the number of Worker Processes in that pool it may take a min for it to completely spin down so it can accept the start command.

Also, I would think you would have to restart the pool in order for the app_offline.htm to work effectively anyway.


Here's the thing. Everytime when you open the .sln at the server, or updating the code, it will create the app_offline ticket in the root. This is the feature from asp.net itself to prevent any access to disturb your development.

Delete the app_offline manually everytime after you open the .sln.

hope this help. thanks.


Another possibility is a missing handler. The following handler is required:

ExtensionlessUrlHandler-Integrated-4.0


To fix the issue you need to at a minimum:

  • Wait the length of your website timeout to ensure all requests have finished.
    • Background processes kicked off from a web request will mean further extending the length of time you wait beyond the website timeout
  • Unload any unmanaged code by hooking into the DomainUnload or Application_End events

I'm waiting 3 minutes for App_Offline.htm to take affect and this seems has allowed App_Offline.htm to work as expected.

0

精彩评论

暂无评论...
验证码 换一张
取 消