Skip to content

net: a smart way to check internal/poll ErrTimeout #32735

Open
@detailyang

Description

@detailyang

Hello guys.

It looks like we have no smart way to check the internal/poll ErrTimeout when we set the deadline on the connection.

The net.Error interface is not good enough as following

An Error represents a network error.

type Error interface {
        error
        Timeout() bool   // Is the error a timeout?
        Temporary() bool // Is the error temporary?
}

The Timeout() method may mislead caller think it's deadline error if the error is actually caused by sycall.Errno (e == EAGAIN || e == EWOULDBLOCK || e == ETIMEDOUT) rather than internal/poll ErrTimeout

Maybe we need a smart way to check the deadline error?

Many thanks in advance:)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions