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

x/net/http2: server writes after timeout should return os.ErrDeadlineExceeded #56478

Closed
neild opened this issue Oct 28, 2022 · 3 comments
Closed
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@neild
Copy link
Contributor

neild commented Oct 28, 2022

A HTTP/2 handler that writes to the ResponseWriter after Server.WriteTimeout has expired gets a http2: stream closed error. It should get an error for which errors.Is(err, os.ErrDeadlineExceeded) is true.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/446255 mentions this issue: net/http: add tests for Server.ReadTimeout and server.WriteTimeout

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/446257 mentions this issue: http2: return os.ErrDeadlineExceeded from timed-out response body writes

@seankhliao seankhliao added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 1, 2022
gopherbot pushed a commit to golang/net that referenced this issue Nov 4, 2022
When a server handler writes to a response body after Server.WriteTimeout
has expired, return an error matching os.ErrDeadlineExceeded rather than
"http2: stream closed".

Tested by net/http CL 446255.

For golang/go#56478

Change-Id: I94494cc7e7f8f9a01a663de09fd5b73acc8ea4e4
Reviewed-on: https://go-review.googlesource.com/c/net/+/446257
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
gopherbot pushed a commit that referenced this issue Nov 10, 2022
We don't seem to have tests verifying that handler reads from the
request body or writes to the response body time out properly.
Add some.

For #49837
For #56478

Change-Id: I0828edd6c86b071073fd1b22ccbb24f86114ab94
Reviewed-on: https://go-review.googlesource.com/c/go/+/446255
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
WeiminShang added a commit to WeiminShang/net that referenced this issue Nov 16, 2022
When a server handler writes to a response body after Server.WriteTimeout
has expired, return an error matching os.ErrDeadlineExceeded rather than
"http2: stream closed".

Tested by net/http CL 446255.

For golang/go#56478

Change-Id: I94494cc7e7f8f9a01a663de09fd5b73acc8ea4e4
Reviewed-on: https://go-review.googlesource.com/c/net/+/446257
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
@seankhliao seankhliao modified the milestones: Unplanned, Go1.20 Nov 19, 2022
@gopherbot gopherbot modified the milestones: Go1.20, Go1.21 Feb 1, 2023
@gopherbot gopherbot modified the milestones: Go1.21, Go1.22 Aug 8, 2023
@odeke-em
Copy link
Member

@neild I believe you fixed this issue in https://go-review.googlesource.com/c/net/+/446257 hence I shall close this issue, please reopen if otherwise and thank you for reporting plus fixing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants