Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.17k stars 4.53k forks source link

[BUG] - ServiceBusSessionReceiver creation intermittently throwing ServiceBusConnection has already been closed and cannot perform the requested operation error. #43470

Open wk-ashish opened 2 months ago

wk-ashish commented 2 months ago

Library name and version

Azure.Messaging.ServiceBus 7.17.2

Describe the bug

ServiceBusSessionReceiver intermittently throwing ServiceBusConnectionhas already been closed and cannot perform the requested operation error.

DEBUG log

An exception occurred while creating a ServiceBusSessionReceiver (Namespace '', Entity path ''). Error Message: 'System.ObjectDisposedException: ServiceBusConnection has already been closed and cannot perform the requested operation.
Object name: 'ServiceBusConnection'.
   at Azure.Core.Argument.AssertNotDisposed(Boolean wasDisposed, String targetName)
   at Azure.Messaging.ServiceBus.ServiceBusConnection.ThrowIfClosed()
   at Azure.Messaging.ServiceBus.ServiceBusReceiver..ctor(ServiceBusConnection connection, String entityPath, Boolean isSessionEntity, ServiceBusReceiverOptions options, String sessionId, Boolean isProcessor, CancellationToken cancellationToken)'

Expected behavior

It should not produce this random errors

Actual behavior

Logs fill up with errors that are not errors

Reproduction Steps

Environment

No response

github-actions[bot] commented 2 months ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.