Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: document the meaning of "Temporary" and "Timeout" #48268

Open
jmhodges opened this issue Sep 8, 2021 · 2 comments
Open

net: document the meaning of "Temporary" and "Timeout" #48268

jmhodges opened this issue Sep 8, 2021 · 2 comments

Comments

@jmhodges
Copy link
Contributor

@jmhodges jmhodges commented Sep 8, 2021

The docs for net have a lot of Temporary and Timeout error methods in them, but the package level docs don't contain a discussion of what those errors mean. The Temporary methods are mentioned in blog post about error handling but don't actually describe their meaning in detail.

And then for the errors types specifically, if an error type have both Temporary and Timeout, it'd be nice to document if both can be true at once and what that means semantically. (This originally cropped up when trying to explain if and when an error in a lower-level network protocol would or would not be counted against a rate limit in a higher-level one.)

@seankhliao
Copy link
Contributor

@seankhliao seankhliao commented Sep 8, 2021

Related #45729

@neild
Copy link
Contributor

@neild neild commented Sep 9, 2021

Temporary is deprecated in CL 340261. Please don't use it; I can pretty much guarantee that it doesn't do what you want, whatever that may be. See #45729 for an exhaustive list of places where the standard library returns an error with a Temporary method returning true.

I think Timeout is reasonably self-explanatory, and the more subtle details are better documented in specific functions returning errors. For example, Conn.SetDeadline states that the error returned when a deadline is exceeded will have a Timeout method that returns true.

@cagedmantis cagedmantis added this to the Backlog milestone Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants