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
{{ message }}
Repository navigation
Detect name resolution errors in QuicConnection.ConnectAsync #89095
changed the title [-][HttpRequestError] Map QUIC errors to HttpRequestError if possible[/-][+][HttpRequestError] Detect NameResolutionError with Quic[/+]on Aug 2, 2023
Thinking that QuicException.TransportErrorCode would help identifying relevant error cases was a wrong assumption.
The actual problem here, similarly to #89096 is that we can't detect NameResolutionError. If QuicClientConnectionOptions.ClientAuthenticationOptions.TargetHost is different than the actual host, FinishConnectAsync will resolve the addresses, and in case it fails a SocketException(SocketError.HostNotFound) will correctly surface to the user. But this is not the case with HTTP/3 logic where we have host == QuicClientConnectionOptions.ClientAuthenticationOptions.TargetHost. In this case we leave the leave the name resolution to msquic, which will fail with the mysterious error code -2147013895 (0x80072af9) on Windows and QUIC_STATUS_INVALID_PARAMETER on Linux.
A robust fix would be to do the name resolution in S.N.Quic code, running a multi-connect attempt similar to Socket.'s DnsConnectAsync. Since there is no multi-connect in msquic anyways (microsoft/msquic#1181), it might be good enough to also take the first resolved address for the host == TargetHost case.
changed the title [-][HttpRequestError] Detect NameResolutionError with Quic[/-][+]Detect name resolution errors in QuicConnection.ConnectAsync[/+]on Aug 2, 2023
Sorry, I forgot about that one. In case we want a simple fix for the HttpRequestError problem, I wonder if we can get rid of the host.Equals(options.ClientAuthenticationOptions.TargetHost)special-casing, always resolving the name & setting a QUIC_PARAM_CONN_REMOTE_ADDRESS to the first address? Or do we expect problematic side-effects from doing so? If we are unwilling to do such a change for 8.0, let's close this issue as a dupe of #82404.
Yeah, I think we could do that, i.e. remove that part of the condition and do name resolution ourselves. I see no problem with that. @wfurt, just checking if you see any potential issues with that? If not, Anton go ahead.
I think that should be ok. It is more work but we do it anyway and it possibly opens avenue to deal better with names that remove to multiple addresses.
ghost added
in-prThere is an active PR which will close this issue when it is merged
Activity
[-][HttpRequestError] Map QUIC errors to HttpRequestError if possible[/-][+][HttpRequestError] Detect NameResolutionError with Quic[/+]antonfirsov commentedon Aug 2, 2023
Thinking that
QuicException.TransportErrorCodewould help identifying relevant error cases was a wrong assumption.The actual problem here, similarly to #89096 is that we can't detect
NameResolutionError. IfQuicClientConnectionOptions.ClientAuthenticationOptions.TargetHostis different than the actual host,FinishConnectAsyncwill resolve the addresses, and in case it fails aSocketException(SocketError.HostNotFound)will correctly surface to the user. But this is not the case with HTTP/3 logic where we havehost == QuicClientConnectionOptions.ClientAuthenticationOptions.TargetHost. In this case we leave the leave the name resolution to msquic, which will fail with the mysterious error code-2147013895 (0x80072af9)on Windows andQUIC_STATUS_INVALID_PARAMETERon Linux.Quic repro
A robust fix would be to do the name resolution in S.N.Quic code, running a multi-connect attempt similar to Socket.'s DnsConnectAsync. Since there is no multi-connect in msquic anyways (microsoft/msquic#1181), it might be good enough to also take the first resolved address for the
host == TargetHostcase.cc @karelz @ManickaP @CarnaViire, not sure how critical is this for 8.0, you may want to punt this.
[-][HttpRequestError] Detect NameResolutionError with Quic[/-][+]Detect name resolution errors in QuicConnection.ConnectAsync[/+]ManickaP commentedon Aug 3, 2023
Seems like dupe of #82404
antonfirsov commentedon Aug 3, 2023
Sorry, I forgot about that one. In case we want a simple fix for the
HttpRequestErrorproblem, I wonder if we can get rid of thehost.Equals(options.ClientAuthenticationOptions.TargetHost)special-casing, always resolving the name & setting aQUIC_PARAM_CONN_REMOTE_ADDRESSto the first address? Or do we expect problematic side-effects from doing so? If we are unwilling to do such a change for 8.0, let's close this issue as a dupe of #82404.ManickaP commentedon Aug 3, 2023
Yeah, I think we could do that, i.e. remove that part of the condition and do name resolution ourselves. I see no problem with that. @wfurt, just checking if you see any potential issues with that? If not, Anton go ahead.
antonfirsov commentedon Aug 3, 2023
Tentatively re-assigned myself. Will bring it up in todays meeting, and file a PR if we have consensus. (If no, let's close it as a dupe.)
wfurt commentedon Aug 3, 2023
I think that should be ok. It is more work but we do it anyway and it possibly opens avenue to deal better with names that remove to multiple addresses.