Skip to content

Commit b23e91f

Browse files
committed
* Catch System.Threading.Channels.ChannelClosedException when aborting
1 parent 7e8a1e9 commit b23e91f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

projects/RabbitMQ.Client/client/impl/Connection.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
using System.IO;
3636
using System.Runtime.CompilerServices;
3737
using System.Threading;
38+
using System.Threading.Channels;
3839
using System.Threading.Tasks;
3940
using RabbitMQ.Client.Events;
4041
using RabbitMQ.Client.Exceptions;
@@ -335,6 +336,13 @@ await _session0.TransmitAsync(method, cancellationToken)
335336
.ConfigureAwait(false);
336337
}
337338
}
339+
catch (ChannelClosedException)
340+
{
341+
if (false == abort)
342+
{
343+
throw;
344+
}
345+
}
338346
catch (AlreadyClosedException)
339347
{
340348
if (false == abort)

projects/Test/Integration/TestConnectionShutdown.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public async Task TestDisposedWithSocketClosedOutOfBand()
113113
_conn = null;
114114
_channel = null;
115115
}
116-
117116
}
118117

119118
[Fact]

0 commit comments

Comments
 (0)