U4-9108 - See if we need to move the servers lock from umbracoNode to umbracoLock (same as v8) to avoid deadlocks

Created by Shannon Deminick 24 Oct 2016, 12:23:34 Updated by Shannon Deminick 16 Nov 2016, 12:10:23

Subtask of: U4-9085

See if we need to move the servers lock from umbracoNode to umbracoLock (same as v8) to avoid deadlocks

We can't make DB Changes for a patch version - so determine if we should just remove this lock for now and consider how many people that would actually affect.

Investigate how we can properly de-activate master election when we know we're only running in a single server setup (config?).

Comments

Stephan 24 Oct 2016, 13:04:21

note: keep the umbracoLock code for 7.6 = create its own issue


Stephan 25 Oct 2016, 09:32:14

Note: we probably can disable master election (testing now) but we cannot disable instructions in the table, as they are used to support "implicit-LB" ie what happens when one AppDomain is going down and another one is starting. As this was put in place to fix some cache refresh issues during heavy restarts... we probably don't want to disable it.


Stephan 25 Oct 2016, 10:19:59

More notes (because it took me time to remember): the multi-AppDomain scenario is this: domain 1 publishes some content and needs to update the XML cache, but meanwhile domain 2 took over and now it is the main domain, so domain 1 does not write the umbraco.config file, so domain 2 needs to process instructions to ensure everything is in sync.


Stephan 25 Oct 2016, 10:33:01

PR https://github.com/umbraco/Umbraco-CMS/pull/1543

test:

  • clear the umbracoServer table
  • start the site
  • ensure that the umbracoServer table contains one row

This is the default, expected behavior. Now, add the following appSettings:

then:

  • clear the umbracoServer table
  • start the site
  • ensure that the umbracoServer table remains empty

Now, the unique server always run with role "Single" and no election takes place.


Shannon Deminick 15 Nov 2016, 11:34:57

I get a ysod when I restart the site with that app setting key:

Server Error in '/' Application.

Current has not been initialized on Umbraco.Core.Sync.ServerRegistrarResolver. You must initialize Current before trying to read it.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Current has not been initialized on Umbraco.Core.Sync.ServerRegistrarResolver. You must initialize Current before trying to read it.

Source Error: 


Line 65: 							"Current has not been initialized on {0}. You must initialize Current before trying to read it.",
Line 66: 							typeof(TResolver).FullName));
Line 67: 					return _resolver;
Line 68: 				}
Line 69: 			}

Source File: X:\Projects\Umbraco\Umbraco_7.5\src\Umbraco.Core\ObjectResolution\ResolverBase.cs    Line: 67 

Stack Trace: 


[InvalidOperationException: Current has not been initialized on Umbraco.Core.Sync.ServerRegistrarResolver. You must initialize Current before trying to read it.]
   Umbraco.Core.ObjectResolution.ResolverBase`1.get_Current() in X:\Projects\Umbraco\Umbraco_7.5\src\Umbraco.Core\ObjectResolution\ResolverBase.cs:67
   Umbraco.Core.Sync.ApplicationUrlHelper.TrySetApplicationUrl(ApplicationContext appContext, IUmbracoSettingsSection settings) in X:\Projects\Umbraco\Umbraco_7.5\src\Umbraco.Core\Sync\ApplicationUrlHelper.cs:117
   Umbraco.Core.Sync.ApplicationUrlHelper.EnsureApplicationUrl(ApplicationContext appContext, HttpRequestBase request, IUmbracoSettingsSection settings) in X:\Projects\Umbraco\Umbraco_7.5\src\Umbraco.Core\Sync\ApplicationUrlHelper.cs:55
   Umbraco.Core.ApplicationContext.get_UmbracoApplicationUrl() in X:\Projects\Umbraco\Umbraco_7.5\src\Umbraco.Core\ApplicationContext.cs:263
   Umbraco.Core.Sync.SingleServerRegistrar..ctor() in X:\Projects\Umbraco\Umbraco_7.5\src\Umbraco.Core\Sync\SingleServerRegistrar.cs:13
   Umbraco.Core.CoreBootManager.InitializeResolvers() in X:\Projects\Umbraco\Umbraco_7.5\src\Umbraco.Core\CoreBootManager.cs:462
   Umbraco.Web.WebBootManager.InitializeResolvers() in X:\Projects\Umbraco\Umbraco_7.5\src\Umbraco.Web\WebBootManager.cs:375
   Umbraco.Core.CoreBootManager.Initialize() in X:\Projects\Umbraco\Umbraco_7.5\src\Umbraco.Core\CoreBootManager.cs:127
   Umbraco.Web.WebBootManager.Initialize() in X:\Projects\Umbraco\Umbraco_7.5\src\Umbraco.Web\WebBootManager.cs:118
   Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e) in X:\Projects\Umbraco\Umbraco_7.5\src\Umbraco.Core\UmbracoApplicationBase.cs:55
   Umbraco.Core.UmbracoApplicationBase.Application_Start(Object sender, EventArgs e) in X:\Projects\Umbraco\Umbraco_7.5\src\Umbraco.Core\UmbracoApplicationBase.cs:88

[HttpException (0x80004005): Current has not been initialized on Umbraco.Core.Sync.ServerRegistrarResolver. You must initialize Current before trying to read it.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +540
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +186
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343

[HttpException (0x80004005): Current has not been initialized on Umbraco.Core.Sync.ServerRegistrarResolver. You must initialize Current before trying to read it.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +539
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +125
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +731

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1586.0


Stephan 15 Nov 2016, 12:27:11

wtf? checking


Stephan 15 Nov 2016, 12:45:02

some missing change apparently, pushed, site working on my side


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.5.5

Sprint: Sprint 46

Story Points: 1.5

Cycle: