Skip to content

Commit 7b203f1

Browse files
MikhailTushevAzureAD\MikhailTushev
and
AzureAD\MikhailTushev
authored
issue-304 - solve problem with memory leak. Added closing connection (#306)
Co-authored-by: AzureAD\MikhailTushev <[email protected]>
1 parent 129c3e7 commit 7b203f1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

RabbitMQ.Stream.Client/RoutingClient.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ private static async Task<IClient> LookupConnection(
9292
advertisedPort = GetPropertyValue(client.ConnectionProperties, "advertised_port");
9393
if (attemptNo > maxAttempts)
9494
{
95+
await client.Close($"advertised_host or advertised_port doesn't match after {attemptNo} attempts")
96+
.ConfigureAwait(false);
97+
9598
throw new RoutingClientException(
9699
$"Could not find broker ({broker.Host}:{broker.Port}) after {maxAttempts} attempts");
97100
}

0 commit comments

Comments
 (0)