Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Mar 27, 2024
1 parent a41da35 commit 1eaa885
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Expand Up @@ -50,8 +50,8 @@ public Task UpdateSecretAsync(string newSecret, string reason)

internal void NotifyReceivedCloseOk()
{
_closed = true;
MaybeTerminateMainloopAndStopHeartbeatTimers(cancelMainLoop: true);
_closed = true;
}

internal void HandleConnectionBlocked(string reason)
Expand Down
7 changes: 6 additions & 1 deletion projects/RabbitMQ.Client/client/impl/Connection.Heartbeat.cs
Expand Up @@ -117,7 +117,12 @@ private async void HeartbeatReadTimerCallback(object? state)
if (shouldTerminate)
{
MaybeTerminateMainloopAndStopHeartbeatTimers();
await FinishCloseAsync(_mainLoopCts.Token)
/*
* Note: do NOT use the main loop cancellation token,
* because FininshCloseAsync immediately cancels it
*/
using var cts = new CancellationTokenSource(InternalConstants.DefaultConnectionAbortTimeout);
await FinishCloseAsync(cts.Token)
.ConfigureAwait(false);
}
else
Expand Down

0 comments on commit 1eaa885

Please sign in to comment.