Skip to content

Commit 9fabb5b

Browse files
committed
AutorecoveringModel.IsClosed should return true if model is unusable
As per the description of [`IsClosed` on `IModel.cs`](https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/4d624be819061c9272c406a7c5250ee24eaa759f/projects/RabbitMQ.Client/client/api/IModel.cs#L85-L88), this property should "return[s] true if the model is no longer in a state where it can be used". At present this returns `false` if the `_delegate` has been disposed of - which I would say indicates that the model "is no longer in a state where it can be used". Fixes regression introduced as part of 54f7840 by aligning the behaviour of `IsClosed` with the underlying [implementation](https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/c9201e4f4ffb62206ca9c7bbca76ea68fe24345f/projects/RabbitMQ.Client/client/impl/ModelBase.cs#L161-L164) that would have been called were the delegate not disposed of.
1 parent 4d624be commit 9fabb5b

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,7 @@ public bool IsClosed
360360
{
361361
get
362362
{
363-
if (_delegate == null)
364-
{
365-
return false;
366-
}
367-
else
368-
{
369-
return _delegate.IsClosed;
370-
}
363+
return !IsOpen;
371364
}
372365
}
373366

0 commit comments

Comments
 (0)