Skip to content

Commit 1e42d00

Browse files
committed
* Ignore OperationCanceledException in heartbeat loop if main loop is canceled
1 parent 405e656 commit 1e42d00

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ await FinishCloseAsync(cts.Token)
130130
_heartbeatReadTimer?.Change((int)Heartbeat.TotalMilliseconds, Timeout.Infinite);
131131
}
132132
}
133+
catch (OperationCanceledException)
134+
{
135+
if (false == _mainLoopCts.IsCancellationRequested)
136+
{
137+
throw;
138+
}
139+
}
133140
catch (ObjectDisposedException)
134141
{
135142
// timer is already disposed,

0 commit comments

Comments
 (0)