You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NuGet.Protocol.Core.Types.FatalProtocolException : An error occurred while retrieving package metadata for 'Microsoft.NETFramework.ReferenceAssemblies.net48.1.0.2' from source 'dotnet-public'.
---- System.Threading.Tasks.TaskCanceledException : The request was canceled due to the configured HttpClient.Timeout of -0.001 seconds elapsing.
-------- System.TimeoutException : The operation was canceled.
------------ System.Threading.Tasks.TaskCanceledException : The operation was canceled.
---------------- System.TimeoutException : A connection could not be established within the configured ConnectTimeout.
Apparently the timeout was set to Timeout.InfiniteTimeSpan, which is -1 ms. Presumably this couldn't have expired, so the message is confusing. I don't have a repro, so feel free to close if it's not important.
Triage: It seems we are doing the right thing in the ConnectionPool, but HttpClient overrides it (and wraps with TImeoutException even if the timeout is not set) -- we should fix that.
Activity
danmoseley commentedon Apr 3, 2022
#67508
MihaZupan commentedon Apr 3, 2022
The relevant code path that determines the exception type:
runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs
Lines 607 to 609 in 1c2198e
We should differentiate between a regular timeout and the
ConnectTimeout.Ideally, we would also expose such info in a programmatical way to the user. This recently came up in YARP as well (dotnet/yarp#1628).
karelz commentedon Apr 7, 2022
Triage: It seems we are doing the right thing in the ConnectionPool, but HttpClient overrides it (and wraps with TImeoutException even if the timeout is not set) -- we should fix that.