From eb5be9f1bfa4465e0c16d1ae4ed146d942ec27fd Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Wed, 24 Apr 2024 12:15:46 -0700 Subject: [PATCH] * Use `TrySetException` because tcs may have already completed. --- projects/RabbitMQ.Client/client/impl/AsyncRpcContinuations.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/RabbitMQ.Client/client/impl/AsyncRpcContinuations.cs b/projects/RabbitMQ.Client/client/impl/AsyncRpcContinuations.cs index 64f4e86539..ff7752437d 100644 --- a/projects/RabbitMQ.Client/client/impl/AsyncRpcContinuations.cs +++ b/projects/RabbitMQ.Client/client/impl/AsyncRpcContinuations.cs @@ -111,7 +111,7 @@ public ConfiguredTaskAwaitable.ConfiguredTaskAwaiter GetAwaiter() public virtual void HandleChannelShutdown(ShutdownEventArgs reason) { - _tcs.SetException(new OperationInterruptedException(reason)); + _tcs.TrySetException(new OperationInterruptedException(reason)); } protected virtual void Dispose(bool disposing)