U4-5491 - Distributed calls won't work if IIS sites between servers have the same HttpRuntime.AppDomainAppId

Created by Shannon Deminick 16 Sep 2014, 00:09:09 Updated by Paul Aikman 15 Jul 2015, 09:41:36

Relates to: U4-5492

Relates to: U4-2633

In most cases each server's IIS site taking part in a load balanced environment will have a different HttpRuntime.AppDomainAppId. However there are definitely scenarios where this is not the case and therefore a distributed call to a 'slave' server that has the same HttpRuntime.AppDomainAppId as the 'master' server will not have it's cache refreshed.

Work around:

  • Create a new IIS site on the slave server(s), copy all of the details required to run the site over.
  • Delete the existing IIS site on the slave server(s)
  • This should ensure that there is a different HttpRuntime.AppDomainAppId on the slave server to the master server

The fix:

  • Instead of passing in just the HttpRuntime.AppDomainAppId to the cacheRefresher.BeginBulkRefresh, we will pass in a hash of the current machine name and the HttpRuntime.AppDomainAppId, this will ensure that if other server's IIS sites have the same HttpRuntime.AppDomainAppId as the master, it will still work since the machine names will be different. Even if load balancing on the same machine for testing, the HttpRuntime.AppDomainAppId will always be different so this will always work.

1 Attachments

Download umbraco.dll

Comments

Shannon Deminick 16 Sep 2014, 00:59:11

Fixed in rev: 7437240d096dbec6086dea64efeb29b27e19458a


Shannon Deminick 16 Sep 2014, 23:22:48

Posts with work arounds:

http://our.umbraco.org/forum/getting-started/installing-umbraco/55867-Setting-up-distributedcall-for-Umbraco-load-balancing-with-Umbraco-7?p=1#comment193598

http://our.umbraco.org/forum/getting-started/installing-umbraco/56309-Load-balancing-distributed-call-not-updating-cache-(716)?p=0#comment193620


Zac 17 Sep 2014, 16:10:19

For those in need, we built a custom 7.1.6 build with only this fix added. We've tested and it works great for us.


Joe 03 Nov 2014, 15:28:07

I am having issues with Umbraco 6.2.4 and distributed publishing. I need to publish twice to distributed servers to have their Examine indexes updated correctly. It looks like the XML cache if not refreshed in time. Is this likely to be fixed in a version 6 build after 6.2.4?


Shannon Deminick 11 Nov 2014, 04:04:11

As per my last msg on the other thread, if this is an issue that you can replicate, you'll need to create an issue for it with all of the required details.


Peter Dolkens 09 Dec 2014, 23:09:43

Similar to @Zac above, for anyone who needs a custom 7.1.8 build with only this fix: https://github.com/alluran/Umbraco-CMS/tree/7.1.8-U4-5491


Tom Pipe 07 Jan 2015, 15:46:29

Just encountered this issue. For the workaround there is no need to delete the site and recreate it. The site ID can be edited in IIS advanced settings


Shannon Deminick 07 Jan 2015, 22:44:02

good to know, thanks!


Stefan Kip 18 Mar 2015, 10:28:34

Isn't this fix included in Umbraco v6.2.5? I think this really should be backported to Umbraco v6...


Shannon Deminick 18 Mar 2015, 22:58:38

It's not ported back to 6.x, you'll need to use the workarounds described in the our posts above, this one's probably the simplest:

https://our.umbraco.org/forum/getting-started/installing-umbraco/55867-Setting-up-distributedcall-for-Umbraco-load-balancing-with-Umbraco-7?p=1#comment193598


Stefan Kip 08 Apr 2015, 08:02:07

@Shandem I've used the work-around for a while, but now I need to introduce SQL Server Session State, which demands the AppId in IIS to be the same for every application in order for shared sessions to work. So right now it's kind of impossible to get v6.X working on a load-balanced environment with Session sharing... Now what? Should I do a custom build? Or is this important enough for a v6.2.6 for instance?


Shannon Deminick 08 Apr 2015, 08:05:45

You'll probably need a custom build yes. Happy to accept a PR with the back ported changes for the dev-v6 branch so at least the code you are working with will be in the main Umbraco repository just in case there's any future security releases that need to be made, the change will exist there.


Stefan Kip 08 Apr 2015, 08:07:49

Ouch :-( I'll see what I can do to create a PR.


Paul Aikman 13 Jul 2015, 14:36:42

@kipusoep wondering if this fix was merged back in for Umbraco 6? Facing the same situation as yourself!


Stefan Kip 13 Jul 2015, 14:39:14

@paulaik@gmail.com Nope, it's completely silent unfortunately: https://github.com/umbraco/Umbraco-CMS/pull/669


Paul Aikman 13 Jul 2015, 14:53:40

@kipusoep arg! A bit of a pain to manage custom builds in a world of NuGet references and package updates. Thanks for the fix though!


Shannon Deminick 13 Jul 2015, 14:55:44

you can do a custom build with a new build number and host on myget, that should work pretty seamlessly for you.


Paul Aikman 15 Jul 2015, 09:41:36

@Shandem thanks, I'll give that a go,.


Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 6.2.5

Due in version: 7.2.0

Sprint:

Story Points:

Cycle: