[go] net/http: fix hang in TestTransportClosesBodyOnError/h3

0 views
Skip to first unread message

Nicholas Husin (Gerrit)

unread,
May 13, 2026, 3:53:24 PM (3 days ago) May 13
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Nicholas Husin, Damien Neil, Dmitri Shuralyov, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com

Nicholas Husin submitted the change

Change information

Commit message:
net/http: fix hang in TestTransportClosesBodyOnError/h3

TestTransportClosesBodyOnError could hang intermittently on HTTP/3 when
the transport encounters an error too early while reading the request
body. In HTTP/3 over QUIC, a stream reset is abrupt and can cause the
server to skip invoking the handler if the reset arrives before headers
are fully processed. This will leave the test waiting indefinitely for
the server handler to run, which will never happen.

Fix this issue by adding "Expect: 100-continue" header to the request.
This guarantees that the server handler has started before the client
attempts to send the request body and encounters the error.

For #78737
Change-Id: I56092e78973f067eab3309231956305f6a6a6964
Reviewed-by: Dmitri Shuralyov <dmit...@golang.org>
Reviewed-by: Damien Neil <dn...@google.com>
Reviewed-by: Nicholas Husin <hu...@google.com>
Files:
  • M src/net/http/transport_test.go
Change size: XS
Delta: 1 file changed, 8 insertions(+), 0 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I56092e78973f067eab3309231956305f6a6a6964
Gerrit-Change-Number: 777740
Gerrit-PatchSet: 2
Gerrit-Owner: Nicholas Husin <n...@golang.org>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Nicholas Husin <hu...@google.com>
Gerrit-Reviewer: Nicholas Husin <n...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages