question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] ServiceBusSessionProcessor should not log ServiceTimeout as an error when accepting sessions

See original GitHub issue

Describe the bug I’ve configured ServiceBusSessionProcessor to listen to the queue and process new messages as they arrive. Unfortunately every minute i’m receiving exception with timeout. I use raw default of ServiceBusSessionProcessor with just queue name.

        public async Task StartAsync(CancellationToken cancellationToken)
        {
            ServiceBusSessionProcessor = _serviceBusClient.CreateSessionProcessor("queue-name");

            ServiceBusSessionProcessor.ProcessMessageAsync += async (ctx) =>
            {
                Logger.Information("Received message, SessionId:{SessionId}", ctx.SessionId);
            };
            
            ServiceBusSessionProcessor.ProcessErrorAsync += (ctx) =>
            {
                Logger.Error(ctx.Exception,"Error occurred when processing message from service bus.");
                return Task.CompletedTask;
            };

            await ServiceBusSessionProcessor.StartProcessingAsync(cancellationToken);
        }

        public async Task StopAsync(CancellationToken cancellationToken)
        {
            await ServiceBusSessionProcessor.StopProcessingAsync(cancellationToken);
        }

Expected behavior No exception thrown

Actual behavior (include Exception or Stack Trace)

EventId: {Id: 85, Name: 'CreateReceiveLinkException'}

An exception occurred while creating receive link for Identifier: queue-name-1e63397e-81f2-40f2-9b07-8d5ea5c9f15b. Error Message: 

System.TimeoutException: The operation did not complete within the allocated time 00:00:59.9958173 for object receiver16.
   at Microsoft.Azure.Amqp.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.Azure.Amqp.AmqpObject.OpenAsyncResult.End(IAsyncResult result)
   at Microsoft.Azure.Amqp.AmqpObject.EndOpen(IAsyncResult result)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location ---
   at Azure.Messaging.ServiceBus.Amqp.AmqpConnectionScope.OpenAmqpObjectAsync(AmqpObject target, TimeSpan timeout)
   at Azure.Messaging.ServiceBus.Amqp.AmqpConnectionScope.OpenReceiverLinkAsync(String identifier, String entityPath, TimeSpan timeout, UInt32 prefetchCount, ServiceBusReceiveMode receiveMode, String sessionId, Boolean isSessionReceiver, CancellationToken cancellationToken)
   at Azure.Messaging.ServiceBus.Amqp.AmqpReceiver.OpenReceiverLinkAsync(TimeSpan timeout, UInt32 prefetchCount, ServiceBusReceiveMode receiveMode, Boolean isSessionReceiver, String identifier)

To Reproduce Just keep it running with no messages in a queue.

Environment:

  • Azure.Messaging.ServiceBus 7.1.0
  • K8s pod with asp.net 5.0 and processor working as hosted service.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
JoshLove-msftcommented, Mar 15, 2021

This issue shouldn’t be closed.

1reaction
JoshLove-msftcommented, Mar 1, 2021

I would propose that when we are attempting to Accept a session from the processor, we log ServiceTimeout as Informational rather than Error. @pawepaw would this change address your concerns?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] - ServiceBusSessionReceiver logs error when trying ...
When creating a ServiceBusSessionReceiver using ServiceBusClient.AcceptNextSessionAsync , given that there are no available sessions and given ...
Read more >
ServiceBusSessionProcessor stopping picking up ...
I do see the SessionIdleTimeout property, but if I'm reading correctly that would just automatically close a specific session, not affect ...
Read more >
Timeout exception when peeking a session enabled topic ...
I have this issues 100% of the times when peeking a subscription with sessions enabled that does not have any active messages. It...
Read more >
Azure ServiceBus errors in production log
We are running MassTransit in production with Azure ServiceBus (ASB) and we frequently get error logs related to the use of the Azure...
Read more >
Azure Service Bus client library for .NET
The event handler args will provide the ability to settle a received message. A Service Bus session processor is scoped to a particular...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found