When ServiceBus scale-out use invalid connection string, it will crash the process #2541

Closed
Xiaohongt opened this Issue Sep 12, 2013 · 3 comments

Comments

Projects
None yet
3 participants
Contributor

Xiaohongt commented Sep 12, 2013

When ServiceBus scale-out use invalid connection string, it will crash the process.

Functional impact:
the process get killed, for iis, all other apps in the app pool will get killed too.

Note,
this repro on both 2.0/2.0.1 and 1.1.3/1.1.4

Repro:

  1. e.g. in Asp.net SignalR sample Startup.SignalR.cs change to use ServiceBus scale-out with invalid connection string
string SBConnectionString = "Endpoint1=sb://test.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=jZsPBWuB85GY4KW9AT7fWUlX1SLn/fhD7py9QUm9i21=";
dependencyResolver.UseServiceBus(SBConnectionString, "Samples");
  1. request Hubs/HubConnectionAPI/Default.aspx
  2. look the process

Actual result:
the process get killed

Expected result:
handle the exception, not crash the process

in 2.0/2.0.1 Servicebus scale-out source code ServiceBusConnection.cs ServiceBusConnection function, the exception is not handled (throw):

            try
            {
                _namespaceManager = NamespaceManager.CreateFromConnectionString(configuration.ConnectionString);
            }
            catch (ConfigurationErrorsException ex)
            {
                _trace.TraceError("Invalid connection string '{0}': {1}", configuration.ConnectionString, ex.Message);

                throw;
            }

in 1.1.3/1.1.4, it is not handled either.

Here are call stacks in 2.0:
System.Configuration.ConfigurationErrorsException occurred
HResult=-2146232062
Message=The Service Bus connection string contains invalid property. 'Endpoint2=sb://signalrtest12.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=jZsPBWuB85GY4KW9AT7fWUlX1SLn/fhD7py9QUm9iew=' is not a valid property within the connection string.
Source=Microsoft.ServiceBus
BareMessage=The Service Bus connection string contains invalid property. '1Endpoint=sb://signalrtest12.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=jZsPBWuB85GY4KW9AT7fWUlX1SLn/fhD7py9QUm9iew=' is not a valid property within the connection string.
Line=0
StackTrace:
at Microsoft.ServiceBus.Messaging.Configuration.KeyValueConfigurationManager.CreateNameValueCollectionFromConnectionString(String connectionString)
at Microsoft.ServiceBus.Messaging.Configuration.KeyValueConfigurationManager..ctor(String connectionString)
at Microsoft.ServiceBus.NamespaceManager.CreateFromConnectionString(String connectionString)
at Microsoft.AspNet.SignalR.ServiceBus.ServiceBusConnection..ctor(ServiceBusScaleoutConfiguration configuration, TraceSource traceSource) in e:\dd\SignalR_Release_2.0\SignalR\src\Microsoft.AspNet.SignalR.ServiceBus\ServiceBusConnection.cs:line 39
at Microsoft.AspNet.SignalR.ServiceBus.ServiceBusMessageBus..ctor(IDependencyResolver resolver, ServiceBusScaleoutConfiguration configuration) in e:\dd\SignalR_Release_2.0\SignalR\src\Microsoft.AspNet.SignalR.ServiceBus\ServiceBusMessageBus.cs:line 38
at Microsoft.AspNet.SignalR.DependencyResolverExtensions.<>c__DisplayClass2.b__0() in e:\dd\SignalR_Release_2.0\SignalR\src\Microsoft.AspNet.SignalR.ServiceBus\DependencyResolverExtensions.cs:line 35
at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

abnanda1 was assigned Sep 12, 2013

Contributor

abnanda1 commented Sep 13, 2013

@Xiaohongt based on the repro steps the un-handled exception is thrown in the section of the code you pointed out in #2541. But yeah issue is the same as #2541 - we need to decide what to do with these exceptions if throwing them crashes all the apps in the app domain. @davidfowl

Owner

davidfowl commented Sep 13, 2013

How does this cause the app domain to crash?

@abnanda1 abnanda1 added a commit that referenced this issue Sep 18, 2013

@abnanda1 abnanda1 Made changes to not throw exceptions in case of configuration, author…
…ization or messaging errors in Service Bus.


#2542   #2541
c879fe7

@abnanda1 abnanda1 added a commit that referenced this issue Sep 19, 2013

@abnanda1 abnanda1 Made changes to not throw exceptions in case of config, auth or messa…
…ging errors in Service Bus


#2542 #2541
8dc3ac4

@abnanda1 abnanda1 added a commit that referenced this issue Sep 23, 2013

@abnanda1 abnanda1 Made changes to not throw exceptions in case of config, auth or messa…
…ging errors in Service Bus


#2542 #2541
3a502ac

@abnanda1 abnanda1 added a commit that referenced this issue Sep 30, 2013

@abnanda1 abnanda1 Made changes to not throw exceptions in case of config, auth or messa…
…ging errors in Service Bus


#2542 #2541
c6ffb08

Xiaohongt was assigned Oct 16, 2013

Contributor

Xiaohongt commented Oct 18, 2013

verified that process not crash anymore in this case

Xiaohongt closed this Oct 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment