Azure QuotaExceededException

329 views
Skip to first unread message

Johan Alkemade

unread,
Mar 15, 2018, 9:40:29 AM3/15/18
to masstransit-discuss
Hi,

I'm implementing masstransit in a project of ours, using Azure Service Bus as the transport and Ninject as our DI solution.
We occasionally get QuotaExceededExceptions. This is the stacktrace:

Microsoft.ServiceBus.Messaging.QuotaExceededException: Cannot allocate more handles to the current session or connection. The maximum number of handles allowed is 4999. Please free up resources and try again., referenceId: 4706a0bec07a4484befb372571b524e6_G18
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
   at Microsoft.ServiceBus.Messaging.Amqp.FaultTolerantObject`1.OnEndCreateInstance(IAsyncResult asyncResult)
   at Microsoft.ServiceBus.Messaging.SingletonManager`1.EndGetInstance(IAsyncResult asyncResult)
   at Microsoft.ServiceBus.Messaging.Amqp.AmqpMessageSender.OnEndOpen(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.ClientEntity.EndOpen(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.OpenOnceManager.OnEndCreateInstance(IAsyncResult asyncResult)
   at Microsoft.ServiceBus.Messaging.SingletonManager`1.EndGetInstance(IAsyncResult asyncResult)
   at Microsoft.ServiceBus.Messaging.OpenOnceManager.OpenOnceManagerAsyncResult`1.OpenComplete(IAsyncResult result)
   at Microsoft.ServiceBus.Common.AsyncResult.SyncContinue(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.OpenOnceManager.OpenOnceManagerAsyncResult`1..ctor(OpenOnceManager openOnceManager, TimeSpan openTimeout, AsyncCallback callback, Object state, Func`3 beginOperation, EndOperation`1 endOperation)
   at Microsoft.ServiceBus.Messaging.OpenOnceManager.Begin(AsyncCallback callback, Object state, Func`3 beginOperation, Action`1 endOperation)
   at Microsoft.ServiceBus.Messaging.MessageSender.BeginSend(TrackingContext trackingContext, IEnumerable`1 messages, TimeSpan timeout, AsyncCallback callback, Object state)
   at Microsoft.ServiceBus.Messaging.MessageSender.BeginSend(BrokeredMessage message, AsyncCallback callback, Object state)
   at Microsoft.ServiceBus.Messaging.MessageSender.<>c.<SendAsync>b__44_0(BrokeredMessage m, AsyncCallback c, Object s)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1](Func`4 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, Object state, TaskCreationOptions creationOptions)
   at System.Threading.Tasks.TaskFactory.FromAsync[TArg1](Func`4 beginMethod, Action`1 endMethod, TArg1 arg1, Object state, TaskCreationOptions creationOptions)
   at System.Threading.Tasks.TaskFactory.FromAsync[TArg1](Func`4 beginMethod, Action`1 endMethod, TArg1 arg1, Object state)
   at Microsoft.ServiceBus.Common.TaskHelpers.FromAsync[TArg1](Func`4 begin, Action`1 end, TArg1 arg1, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MassTransit.Policies.PipeRetryExtensions.<Retry>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at MassTransit.Policies.PipeRetryExtensions.<Retry>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MassTransit.AzureServiceBusTransport.Transport.QueueSendClient.<Send>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MassTransit.AzureServiceBusTransport.Transport.ServiceBusSendTransport.<MassTransit-Transports-ISendTransport-Move>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MassTransit.Pipeline.Filters.MoveExceptionToTransportFilter.<GreenPipes-IFilter<MassTransit-ExceptionReceiveContext>-Send>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at GreenPipes.Filters.RescueFilter`2.<GreenPipes-IFilter<TContext>-Send>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MassTransit.Pipeline.Filters.DeadLetterFilter.<GreenPipes-IFilter<MassTransit-ReceiveContext>-Send>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at MassTransit.AzureServiceBusTransport.Transport.Receiver.<OnMessage>d__13.MoveNext()

This is the way how we are initializing the bus:


            // setup our Masstransit pipeline
            var busControl = MassTransit.Bus.Factory.CreateUsingAzureServiceBus(sbc =>
            {
                sbc.UseSerilog();
                sbc.UseSerilogEnricher();
                sbc.UseJsonSerializer();

                var serviceUri = ServiceBusEnvironment.CreateServiceUri("sb", ConfigurationManager.AppSettings["AzureSbNamespace"], ConfigurationManager.AppSettings["AzureSbPath"]);
                
                var host = sbc.Host(serviceUri, h =>
                {
                    h.TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider(ConfigurationManager.AppSettings["AzureSbKeyName"], ConfigurationManager.AppSettings["AzureSbSharedAccessKey"], TimeSpan.FromDays(1), TokenScope.Namespace);
                });


                sbc.ReceiveEndpoint(host, "siebel-car-data", rec =>
                {
                    rec.Consumer<SiebelCarRecordReceivedConsumer>(Kernel, c => c.UseConcurrencyLimit(1));
                });

            });

And this is the way we setup the Ninject part:


            // bind the bus as a buscontrol, so that we can start and stop it.
            this.Bind<IBusControl>().ToConstant(busControl).InSingletonScope();

            // bind the bus as an IBus
            this.Bind<IBus>().ToProvider(new CallbackProvider<IBus>(x => x.Kernel.Get<IBusControl>()));

Anybody know what could be the problem here?

Chris Patterson

unread,
Mar 15, 2018, 8:59:20 PM3/15/18
to masstrans...@googlegroups.com
Which version of MT, and which version of the Microsoft Azure Service Bus package are being used here? There was a bug in the Azure library a while back.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/badad4bc-724a-4e62-9c2e-c21ee420ba6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Johan Alkemade

unread,
Mar 16, 2018, 6:30:03 AM3/16/18
to masstransit-discuss
We are using Masstransit 4.0.1, Masstransit.AzureServiceBus 4.0.1 and WindowsAzure.ServiceBus 4.1.7
All the latest (non pre-release) packages, according to NuGet

Op vrijdag 16 maart 2018 01:59:20 UTC+1 schreef Chris Patterson:
To post to this group, send email to masstrans...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages