Skip to content

NpgsqlMultiHostDataSource - wrong cancelation handling #6282

@rus-art

Description

@rus-art

AS IS
Npgsql.NpgsqlException is thrown if the calling code cancels the request while the connection is being established.

Npgsql.NpgsqlException (0x80004005): Unable to connect to a suitable host. Check inner exception for more details.
 ---> System.AggregateException: One or more errors occurred. (The operation was canceled.) (The operation was canceled.)
 ---> System.OperationCanceledException: The operation was canceled.
   at System.Threading.CancellationToken.ThrowOperationCanceledException()
   at System.Threading.CancellationToken.ThrowIfCancellationRequested()
   at Npgsql.PoolingDataSource.<Get>g__RentAsync|33_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)

PROPOSAL

TaskCanceledException should be rethrown instead.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions