Skip to content

[API Proposal]: QuicError.AddressNotAvailable #76435

Closed

Description

@pedrobsaila

Background and motivation

Some hosts cannot establish connection to specific addresses because Ipv6/Ipv4 are not enabled on them or more generally they don't support a specific address family. For example : when trying to establish a quic connection to an ipv6 address on a OS where ipv6 is disabled, we would get the following errors :

  • Unix : An internal error has occurred. Status code: Unknown (0x63)
  • Windows : An internal error has occurred. Status code: Unknown (0x80072743)

The goal of this proposal is to return a custom quic error for this case. The new enum would be mapped to :

  • Unix : EAFNOSUPPORT error
  • Windows : WSAENETUNREACH error

This proposal is created on behalf of this issue #74053

API Proposal

namespace System.Net.Quic;

public enum QuicError
    {
       /// <summary>
       /// The requested address is not available on this machine
       /// </summary>
       AddressNotAvailable,
    }

API Usage

try
{
// create quic connection
}
catch (QuicException ex)
{
      if (ex.QuicError == QuicError.AddressNotAvailable)
      {
              Console.WriteLine("The OS does not support this address family ")
      }
}

Alternative Designs

No response

Risks

No response

Activity

  1. added
    api-suggestionEarly API idea and discussion, it is NOT ready for implementation
    on Sep 30, 2022
  2. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Sep 30, 2022
  3. added
    api-ready-for-reviewAPI is ready for review, it is NOT ready for implementation
    and removed
    api-suggestionEarly API idea and discussion, it is NOT ready for implementation
    untriagedNew issue has not been triaged by the area owner
    on Oct 4, 2022
  4. added this to the 8.0.0 milestone on Oct 4, 2022
  5. karelz commented on Oct 4, 2022

    @karelz
    Member

    Triage: Networking team agrees. @rzikm can you please start email-approval, given it is small? Thanks!

  6. bartonjs commented on Nov 15, 2022

    @bartonjs
    Member

    Video

    • The two proposed inputs don't seem to both cleanly map to the same error (POSIX has ENETUNREACH which seems a better match to WSAENETUNREACH)
    • There's already an existing "AddressInUse", which makes it hard for callers to understand why "NotAvailable" is different from "InUse"
    • If it's (based on the EAFNOSUPPORT) address -family- not available, that should be in the name (e.g. AddressFamilyNotAvailable)
    • It doesn't feel like there's actually a scenario where someone needs this value (or these values, if it's multiple), making it unclear why we're making essentially a copy of SocketError.
      • It seems like perhaps a better answer here is to expose the SocketException directly (probably wrapped by QuicException)
    namespace System.Net.Quic;
    
    public partial enum QuicError
    {
        /// <summary>
        /// The requested address family is not available on this machine
        /// </summary>
        AddressNotAvailable,
    }
  7. added
    api-needs-workAPI needs work before it is approved, it is NOT ready for implementation
    and removed
    api-ready-for-reviewAPI is ready for review, it is NOT ready for implementation
    on Nov 15, 2022
  8. wfurt commented on May 1, 2023

    @wfurt
    Member

    Reading this again, It feels like we should change this to AddressFamilyNotAvailable, right @pedrobsaila @ManickaP?
    E.g. this is not about instance of specific address not working but really more about the type. If we agree I can take it back to API review.

  9. rzikm commented on May 2, 2023

    @rzikm
    Member

    @wfurt I like the option of throwing a SocketException better, I have some ideas about how to redesign the exceptions stuff, but generally it is just moving all the low-level (below-QUIC) errors to SocketException, so that we don't have to duplicate SocketError enum.

  10. self-assigned this
    on Jun 8, 2023
  11. wfurt commented on Jun 30, 2023

    @wfurt
    Member

    we shall throw SocketException - similar to #87208.

    Do you want to finish #74053 @pedrobsaila? It should be straight forward once MsQuic taks your change and when we sync up the interop,

  12. pedrobsaila commented on Jun 30, 2023

    @pedrobsaila
    ContributorAuthor

    I'm on vacation until 9 July. I'll be happy to work on it when I'm back. Meanwhile, you can assign it to someone else if it is urgent.

  13. ghost locked as resolved and limited conversation to collaborators on Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api-needs-workAPI needs work before it is approved, it is NOT ready for implementationarea-System.Net.Quic

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions