Azure / azure-amqp

AMQP C# library
Other
94 stars 70 forks source link

Getting a ton of SocketException after upgrading to .net8 #257

Closed ogauthier closed 7 months ago

ogauthier commented 7 months ago

The processor just keeps throwing SocketExceptions with this message:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

On method: Azure.Messaging.EventHubs.Amqp.AmqpConnectionScope+d__80.MoveNext

Once we rollback to .net 7, all theses exception disappear.

xinchen10 commented 7 months ago

I tested connecting to an Azure messaging service directly using the library (version 2.6.4) on .NET 8. It was working.

xinchen10 commented 7 months ago

This is the code I tested.

using Microsoft.Azure.Amqp;

var factory = new AmqpConnectionFactory();
for (int i = 0; i < 1000; i++)
{
    var connection = await factory.OpenConnectionAsync("amqps://mynamespace.servicebus.windows.net");
    await connection.CloseAsync(CancellationToken.None);

    Console.WriteLine($"{i}: connection opened and closed");
}