Azure / azure-service-bus-dotnet

☁️ .NET Standard client library for Azure Service Bus
https://azure.microsoft.com/services/service-bus
Other
235 stars 120 forks source link

SendAsync InvalidOperationException #612

Closed AceHack closed 5 years ago

AceHack commented 6 years ago

Actual Behavior

  1. When calling SendAsync I sometimes get InvalidOperationException invalidoperation System.InvalidOperationException: Can't create session when the connection is closing. at Microsoft.Azure.ServiceBus.Core.MessageSender.OnSendAsync(IList1 messageList) at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func1 operation, TimeSpan operationTimeout) at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func1 operation, TimeSpan operationTimeout) at Microsoft.Azure.ServiceBus.Core.MessageSender.SendAsync(IList1 messageList) at Arch.TestService.ServiceBusTest.RunAsync() in /build/src/Arch.TestService/ServiceBusTest.cs:line 131

Expected Behavior

  1. To always work when calling SendAsync

Versions

axisc commented 5 years ago

@AceHack - do you see this issue when sending messages after a long while. Inactive connections may be closed depending on how you set up the connection.

could you share a repro?

AceHack commented 5 years ago

It’s random, I’m just sending a 20 byte message in a loop every one second. Also there is a message lock exception that happens sometimes too.

AceHack commented 5 years ago

Also, the abstraction for TopicClient is an always working connection. I should not see any errors unless there are actual network errors, it uses fault tolerant amqp connection underneath. I'm using the default retry strategy as well so it should have handled this.

SeanFeldman commented 5 years ago

Also there is a message lock exception that happens sometimes too.

Lock exception on a message sent out?

axisc commented 5 years ago

if you still see this issue, please open a support ticket. closing this issue for now.