go: net/http: TestHijackAfterCloseNotifier failures
#!watchflakes
post <- pkg == "net/http" && test == "TestHijackAfterCloseNotifier" && `want same`
Issue created automatically to collect these failures.
Example (log):
2022/10/17 02:06:33 http: TLS handshake error from 127.0.0.1:21860: EOF
2022/10/17 02:06:35 http: TLS handshake error from 127.0.0.1:46518: write tcp 127.0.0.1:45680->127.0.0.1:46518: i/o timeout
2022/10/17 02:06:35 http: TLS handshake error from 127.0.0.1:2197: write tcp 127.0.0.1:13625->127.0.0.1:2197: i/o timeout
2022/10/17 02:06:36 http: TLS handshake error from 127.0.0.1:45371: write tcp 127.0.0.1:38635->127.0.0.1:45371: i/o timeout
2022/10/17 02:06:36 http: TLS handshake error from 127.0.0.1:45248: write tcp 127.0.0.1:11478->127.0.0.1:45248: i/o timeout
2022/10/17 02:06:36 http2: server: error reading preface from client 127.0.0.1:16541: bogus greeting "CONNECT golang.fake.tld:"
2022/10/17 02:06:37 http2: server: error reading preface from client 127.0.0.1:20393: bogus greeting "CONNECT golang.fake.tld:"
--- FAIL: TestHijackAfterCloseNotifier (0.00s)
--- FAIL: TestHijackAfterCloseNotifier/h1 (0.13s)
serve_test.go:3324: addr1, addr2 = "127.0.0.1:43885", "127.0.0.1:44395"; want same
2022/10/17 02:06:51 http: TLS handshake error from 127.0.0.1:34478: EOF
2022/10/17 02:06:51 http: TLS handshake error from 127.0.0.1:16556: EOF
2022/10/17 02:07:00 http: TLS handshake error from 127.0.0.1:24764: write tcp 127.0.0.1:42504->127.0.0.1:24764: use of closed network connection
2022/10/17 02:07:00 http: TLS handshake error from 127.0.0.1:17591: write tcp 127.0.0.1:42504->127.0.0.1:17591: use of closed network connection
2022/10/17 02:07:00 http: TLS handshake error from 127.0.0.1:7383: write tcp 127.0.0.1:32294->127.0.0.1:7383: use of closed network connection
2022/10/17 02:07:00 http: TLS handshake error from 127.0.0.1:6079: write tcp 127.0.0.1:32294->127.0.0.1:6079: use of closed network connection
2022/10/17 02:07:00 http: TLS handshake error from 127.0.0.1:22550: read tcp 127.0.0.1:32294->127.0.0.1:22550: use of closed network connection
2022/10/17 02:07:00 http: TLS handshake error from 127.0.0.1:26024: write tcp 127.0.0.1:32294->127.0.0.1:26024: use of closed network connection
2022/10/17 02:07:00 http: TLS handshake error from 127.0.0.1:47350: write tcp 127.0.0.1:32294->127.0.0.1:47350: use of closed network connection
2022/10/17 02:07:06 http: TLS handshake error from 127.0.0.1:20490: EOF
2022/10/17 02:07:06 http: TLS handshake error from 127.0.0.1:28231: EOF
2022/10/17 02:07:06 http: TLS handshake error from 127.0.0.1:14732: read tcp 127.0.0.1:41602->127.0.0.1:14732: read: connection reset by peer
2022/10/17 02:07:06 http: TLS handshake error from 127.0.0.1:13282: read tcp 127.0.0.1:41602->127.0.0.1:13282: read: connection reset by peer
2022/10/17 02:07:06 http: TLS handshake error from 127.0.0.1:20888: read tcp 127.0.0.1:41602->127.0.0.1:20888: read: connection reset by peer
2022/10/17 02:07:06 http: TLS handshake error from 127.0.0.1:44183: read tcp 127.0.0.1:22518->127.0.0.1:44183: read: connection reset by peer
2022/10/17 02:07:06 http: TLS handshake error from 127.0.0.1:22949: read tcp 127.0.0.1:22518->127.0.0.1:22949: read: connection reset by peer
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (9 by maintainers)
Ah, that’s the clue! The call to
tryPutIdleConn
only occurs ifpc.wroteRequest()
returns true.I can reproduce this failure mode on Linux by injecting
time.Sleep(100 * time.Millisecond)
before the send topc.writeErrCh
here: https://cs.opensource.google/go/go/+/master:src/net/http/transport.go;l=2440;drc=d633f4b996dadb6b72c2c43d35092738b7c19e7f(Why 100ms? Because it’s somewhat longer than
maxWriteWaitBeforeConnReuse
, which is 50ms.)That same race seems to account for a large number of
net/http
test flakes, including:And a couple of additional failures that have not yet been reported by
watchflakes
.Also related are:
(CC @paulzhol)
No-update update: Looked at this for a bit. Could not replicate on darwin-amd64-race builder. Could not find a plausible explanation for the flake. Admitting defeat for the moment.