azure-sdk-for-net: [BUG] ServiceBusSessionProcessor should not log ServiceTimeout as an error when accepting sessions
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.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 16 (10 by maintainers)
This issue shouldn’t be closed.
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?