{"action":"created","issue":{"url":"https://api.github.com/repos/SignalR/SignalR/issues/3414","labels_url":"https://api.github.com/repos/SignalR/SignalR/issues/3414/labels{/name}","comments_url":"https://api.github.com/repos/SignalR/SignalR/issues/3414/comments","events_url":"https://api.github.com/repos/SignalR/SignalR/issues/3414/events","html_url":"https://github.com/SignalR/SignalR/issues/3414","id":58531279,"number":3414,"title":"MapSignalR hangs in the creation of the Performance Counters","user":{"login":"corneliutusnea","id":346349,"avatar_url":"https://avatars.githubusercontent.com/u/346349?v=3","gravatar_id":"","url":"https://api.github.com/users/corneliutusnea","html_url":"https://github.com/corneliutusnea","followers_url":"https://api.github.com/users/corneliutusnea/followers","following_url":"https://api.github.com/users/corneliutusnea/following{/other_user}","gists_url":"https://api.github.com/users/corneliutusnea/gists{/gist_id}","starred_url":"https://api.github.com/users/corneliutusnea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corneliutusnea/subscriptions","organizations_url":"https://api.github.com/users/corneliutusnea/orgs","repos_url":"https://api.github.com/users/corneliutusnea/repos","events_url":"https://api.github.com/users/corneliutusnea/events{/privacy}","received_events_url":"https://api.github.com/users/corneliutusnea/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-02-23T00:40:59Z","updated_at":"2015-10-31T12:39:37Z","closed_at":null,"body":"Hi,\r\nWith the 2.2.0 build I started to have a problem in the app.MapSignalR() which it gets stuck in creating the Performance Counters. It's hard to reproduce but I get it about 3-4 times a day.\r\n\r\nThis is the callstack:\r\n```\r\n \tSystem.dll!System.Diagnostics.PerformanceCounterLib.GetPerformanceCounterLib(string machineName, System.Globalization.CultureInfo culture)\tUnknown\r\n \tSystem.dll!System.Diagnostics.PerformanceCounterLib.IsCustomCategory(string machine, string category)\tUnknown\r\n \tSystem.dll!System.Diagnostics.PerformanceCounter.InitializeImpl()\tUnknown\r\n>\tSystem.dll!System.Diagnostics.PerformanceCounter.PerformanceCounter(string categoryName, string counterName, string instanceName, bool readOnly)\tUnknown\r\n \tMicrosoft.AspNet.SignalR.Core.dll!Microsoft.AspNet.SignalR.Infrastructure.PerformanceCounterManager.LoadCounter(string categoryName, string counterName, string instanceName, bool isReadOnly)\tUnknown\r\n \tMicrosoft.AspNet.SignalR.Core.dll!Microsoft.AspNet.SignalR.Infrastructure.PerformanceCounterManager.SetCounterProperties()\tUnknown\r\n \tMicrosoft.AspNet.SignalR.Core.dll!Microsoft.AspNet.SignalR.Infrastructure.PerformanceCounterManager.Initialize(string instanceName, System.Threading.CancellationToken hostShutdownToken)\tUnknown\r\n \tMicrosoft.AspNet.SignalR.Core.dll!Microsoft.AspNet.SignalR.Hosting.HostDependencyResolverExtensions.InitializeHost(Microsoft.AspNet.SignalR.IDependencyResolver resolver, string instanceName, System.Threading.CancellationToken hostShutdownToken)\tUnknown\r\n \tMicrosoft.AspNet.SignalR.Core.dll!Owin.OwinExtensions.UseSignalRMiddleware<Microsoft.AspNet.SignalR.Owin.Middleware.HubDispatcherMiddleware>(Owin.IAppBuilder builder, object[] args)\tUnknown\r\n \tMicrosoft.AspNet.SignalR.Core.dll!Owin.OwinExtensions.MapSignalR.AnonymousMethod__0(Owin.IAppBuilder subApp)\tUnknown\r\n \tMicrosoft.Owin.dll!Owin.MapExtensions.Map(Owin.IAppBuilder app, Microsoft.Owin.PathString pathMatch, System.Action<Owin.IAppBuilder> configuration)\tUnknown\r\n \tMicrosoft.Owin.dll!Owin.MapExtensions.Map(Owin.IAppBuilder app, string pathMatch, System.Action<Owin.IAppBuilder> configuration)\tUnknown\r\n \tMicrosoft.AspNet.SignalR.Core.dll!Owin.OwinExtensions.MapSignalR(Owin.IAppBuilder builder, string path, Microsoft.AspNet.SignalR.HubConfiguration configuration)\tUnknown\r\n \tMicrosoft.AspNet.SignalR.Core.dll!Owin.OwinExtensions.MapSignalR(Owin.IAppBuilder builder)\tUnknown\r\n \tSnowSparkle.OneSaas.dll!SnowSparkle.OneSaas.SignalRConfig.Configuration(Owin.IAppBuilder app) Line 22\tC#\r\n \t[Native to Managed Transition]\t\r\n \tMicrosoft.Owin.Host.SystemWeb.dll!Owin.Loader.DefaultLoader.MakeDelegate.AnonymousMethod__b(Owin.IAppBuilder builder)\tUnknown\r\n \tMicrosoft.Owin.Host.SystemWeb.dll!Owin.Loader.DefaultLoader.LoadImplementation.AnonymousMethod__0(Owin.IAppBuilder builder)\tUnknown\r\n \tMicrosoft.Owin.Host.SystemWeb.dll!Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint.AnonymousMethod__0(Owin.IAppBuilder builder)\tUnknown\r\n \tMicrosoft.Owin.Host.SystemWeb.dll!Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(System.Action<Owin.IAppBuilder> startup)\tUnknown\r\n \tMicrosoft.Owin.Host.SystemWeb.dll!Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(System.Action<Owin.IAppBuilder> startup)\tUnknown\r\n \tMicrosoft.Owin.Host.SystemWeb.dll!Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint()\tUnknown\r\n \tmscorlib.dll!System.Threading.LazyInitializer.EnsureInitializedCore<System.__Canon>(ref System.__Canon target, ref bool initialized, ref object syncLock, System.Func<System.__Canon> valueFactory)\tUnknown\r\n \tMicrosoft.Owin.Host.SystemWeb.dll!Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(System.Web.HttpApplication context)\tUnknown\r\n \tSystem.Web.dll!System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(System.IntPtr appContext, System.Web.HttpContext context, System.Reflection.MethodInfo[] handlers)\tUnknown\r\n \tSystem.Web.dll!System.Web.HttpApplication.InitSpecial(System.Web.HttpApplicationState state, System.Reflection.MethodInfo[] handlers, System.IntPtr appContext, System.Web.HttpContext context)\tUnknown\r\n \tSystem.Web.dll!System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(System.IntPtr appContext, System.Web.HttpContext context)\tUnknown\r\n \tSystem.Web.dll!System.Web.Hosting.PipelineRuntime.InitializeApplication(System.IntPtr appContext)\tUnknown\r\n \t[AppDomain Transition]\t\r\n```\r\n\r\nRepro steps:\r\nRun a website in IISExpress. Save the web.config and reload the site several times.\r\nAbout 4-5 tries later of recycling the site it hangs.\r\n\r\nI tried debugging the disassembled code and all I could see is the code jumping indefinitely between those two functions. \r\n```\r\n> \tSystem.dll!System.Diagnostics.PerformanceCounterLib.GetPerformanceCounterLib(string machineName, System.Globalization.CultureInfo culture)\tUnknown\r\n>\tSystem.dll!System.Diagnostics.PerformanceCounterLib.IsCustomCategory(string machine, string category)\tUnknown\r\n```\r\n\r\nThis looks to me like a by-product of this bug:\r\nhttp://connect.microsoft.com/VisualStudio/feedback/details/864245/multithreaded-bug-in-system-diagnostics-performancecounter\r\n\r\nI'd like to have a config value to disable the creation of Performance Counters so I can avoid this problem if possible. "},"comment":{"url":"https://api.github.com/repos/SignalR/SignalR/issues/comments/152733194","html_url":"https://github.com/SignalR/SignalR/issues/3414#issuecomment-152733194","issue_url":"https://api.github.com/repos/SignalR/SignalR/issues/3414","id":152733194,"user":{"login":"zpqrtbnk","id":2846429,"avatar_url":"https://avatars.githubusercontent.com/u/2846429?v=3","gravatar_id":"","url":"https://api.github.com/users/zpqrtbnk","html_url":"https://github.com/zpqrtbnk","followers_url":"https://api.github.com/users/zpqrtbnk/followers","following_url":"https://api.github.com/users/zpqrtbnk/following{/other_user}","gists_url":"https://api.github.com/users/zpqrtbnk/gists{/gist_id}","starred_url":"https://api.github.com/users/zpqrtbnk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zpqrtbnk/subscriptions","organizations_url":"https://api.github.com/users/zpqrtbnk/orgs","repos_url":"https://api.github.com/users/zpqrtbnk/repos","events_url":"https://api.github.com/users/zpqrtbnk/events{/privacy}","received_events_url":"https://api.github.com/users/zpqrtbnk/received_events","type":"User","site_admin":false},"created_at":"2015-10-31T12:39:37Z","updated_at":"2015-10-31T12:39:37Z","body":"One could definitively argue that the problem lies within the PerformanceCounterLib class that should *not* compare CultureInfo instances by reference."}}