Skip to content

When Continuation Timeout, TaskCanceledException is thrown, rather than TimeoutException. #1867

@bill2004158

Description

@bill2004158

Describe the bug

https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/main/projects/RabbitMQ.Client/Impl/AsyncRpcContinuations.cs#L180
if (tcs.TrySetCanceled())
{
tcs.TrySetException(GetTimeoutException());
}

if tcs is set as Canceled,
then Exception won't be set.
await tcs.Task will throw TaskCanceledException!
As a result, the caller cannot get TimeoutException.

Reproduction steps

N/A

Expected behavior

throw TimeoutException.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions