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: TestTransportBodyRewindRace failures #55896

Closed
gopherbot opened this issue Sep 27, 2022 · 5 comments
Closed

x/net/http2: TestTransportBodyRewindRace failures #55896

gopherbot opened this issue Sep 27, 2022 · 5 comments
Assignees
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@gopherbot
Copy link

#!watchflakes
post <- pkg == "golang.org/x/net/http2" && test == "TestTransportBodyRewindRace"

Issue created automatically to collect these failures.

Example (log):

==================
WARNING: DATA RACE
Read at 0x00c000626911 by goroutine 21740:
  net/http.rewindBody()
      /workdir/go/src/net/http/transport.go:667 +0x19b
  net/http.(*Transport).roundTrip()
      /workdir/go/src/net/http/transport.go:621 +0xeb1
  net/http.(*Transport).RoundTrip()
      /workdir/go/src/net/http/roundtrip.go:17 +0x36
  net/http.send()
...
--- FAIL: TestTransportBodyRewindRace (0.50s)
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
...
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47204: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47204: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47204: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47204: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47214: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47214: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47214: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47228: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47228: connection error: PROTOCOL_ERROR
    testing.go:1354: race detected during execution of test

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 27, 2022
@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "golang.org/x/net/http2" && test == "TestTransportBodyRewindRace"
2022-09-27 17:12 linux-amd64-race net@f4863917 go@6485e8f5 x/net/http2.TestTransportBodyRewindRace (log)
==================
WARNING: DATA RACE
Read at 0x00c000626911 by goroutine 21740:
  net/http.rewindBody()
      /workdir/go/src/net/http/transport.go:667 +0x19b
  net/http.(*Transport).roundTrip()
      /workdir/go/src/net/http/transport.go:621 +0xeb1
  net/http.(*Transport).RoundTrip()
      /workdir/go/src/net/http/roundtrip.go:17 +0x36
  net/http.send()
...
--- FAIL: TestTransportBodyRewindRace (0.50s)
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:46894: connection error: PROTOCOL_ERROR
...
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47204: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47204: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47204: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47204: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47214: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47214: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47214: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47228: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:36:55 http2: server connection error from 127.0.0.1:47228: connection error: PROTOCOL_ERROR
    testing.go:1354: race detected during execution of test
2022-09-27 17:12 linux-amd64-race net@f4863917 go@bf5805ea x/net/http2.TestTransportBodyRewindRace (log)
==================
WARNING: DATA RACE
Read at 0x00c0004ef2d1 by goroutine 21753:
  net/http.rewindBody()
      /workdir/go/src/net/http/transport.go:667 +0x19b
  net/http.(*Transport).roundTrip()
      /workdir/go/src/net/http/transport.go:621 +0xeb1
  net/http.(*Transport).RoundTrip()
      /workdir/go/src/net/http/roundtrip.go:17 +0x36
  net/http.send()
...
--- FAIL: TestTransportBodyRewindRace (0.54s)
    http2_test.go:70: 2022/09/27 19:34:17 http2: server connection error from 127.0.0.1:44998: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:17 http2: server connection error from 127.0.0.1:44998: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:17 http2: server connection error from 127.0.0.1:44998: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:17 http2: server connection error from 127.0.0.1:44998: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:17 http2: server connection error from 127.0.0.1:44998: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:17 http2: server connection error from 127.0.0.1:44998: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:17 http2: server connection error from 127.0.0.1:44998: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:17 http2: server connection error from 127.0.0.1:44998: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:17 http2: server connection error from 127.0.0.1:44998: connection error: PROTOCOL_ERROR
...
    http2_test.go:70: 2022/09/27 19:34:18 http2: server connection error from 127.0.0.1:45260: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:18 http2: server connection error from 127.0.0.1:45272: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:18 http2: server connection error from 127.0.0.1:45272: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:18 http2: server connection error from 127.0.0.1:45272: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:18 http2: server connection error from 127.0.0.1:45272: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:18 http2: server connection error from 127.0.0.1:45274: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:18 http2: server connection error from 127.0.0.1:45274: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:18 http2: server connection error from 127.0.0.1:45274: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 19:34:18 http2: server connection error from 127.0.0.1:45290: connection error: PROTOCOL_ERROR
    testing.go:1354: race detected during execution of test
2022-09-27 17:12 linux-amd64-race net@f4863917 go@2b9596cb x/net/http2.TestTransportBodyRewindRace (log)
==================
WARNING: DATA RACE
Read at 0x00c000140659 by goroutine 192:
  net/http.rewindBody()
      /workdir/go/src/net/http/transport.go:666 +0x164
  net/http.(*Transport).roundTrip()
      /workdir/go/src/net/http/transport.go:620 +0xe71
  net/http.(*Transport).RoundTrip()
      /workdir/go/src/net/http/roundtrip.go:17 +0x36
  net/http.send()
...
--- FAIL: TestTransportBodyRewindRace (0.87s)
    http2_test.go:70: 2022/09/27 20:35:13 http2: server connection error from 127.0.0.1:42612: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:13 http2: server connection error from 127.0.0.1:42612: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:13 http2: server connection error from 127.0.0.1:42612: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:13 http2: server connection error from 127.0.0.1:42612: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:13 http2: server connection error from 127.0.0.1:42612: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:13 http2: server connection error from 127.0.0.1:42612: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:13 http2: server connection error from 127.0.0.1:42612: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:13 http2: server connection error from 127.0.0.1:42612: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:13 http2: server connection error from 127.0.0.1:42612: connection error: PROTOCOL_ERROR
...
    http2_test.go:70: 2022/09/27 20:35:14 http2: server connection error from 127.0.0.1:42916: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:14 http2: server connection error from 127.0.0.1:42916: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:14 http2: server connection error from 127.0.0.1:42922: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:14 http2: server connection error from 127.0.0.1:42922: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:14 http2: server connection error from 127.0.0.1:42922: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:14 http2: server connection error from 127.0.0.1:42922: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:14 http2: server connection error from 127.0.0.1:42928: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:14 http2: server connection error from 127.0.0.1:42928: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/27 20:35:14 http2: server connection error from 127.0.0.1:42944: connection error: PROTOCOL_ERROR
    testing.go:1312: race detected during execution of test

watchflakes

@neild neild self-assigned this Sep 27, 2022
@gopherbot
Copy link
Author

Change https://go.dev/cl/435535 mentions this issue: http2: don't return from RoundTrip until request body is closed

@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "golang.org/x/net/http2" && test == "TestTransportBodyRewindRace"
2022-09-27 17:12 freebsd-amd64-race net@f4863917 go@53773a5d x/net/http2.TestTransportBodyRewindRace (log)
==================
WARNING: DATA RACE
Write at 0x00c00034ea79 by goroutine 22327:
  net/http.(*readTrackingBody).Close()
      /tmp/workdir/go/src/net/http/transport.go:642 +0x37
  golang.org/x/net/http2.(*ClientConn).setGoAway.func1()
      /tmp/workdir/gopath/src/golang.org/x/net/http2/transport.go:777 +0x6d
  runtime.deferreturn()
      /tmp/workdir/go/src/runtime/panic.go:476 +0x32
  golang.org/x/net/http2.(*clientConnReadLoop).processGoAway()
...
--- FAIL: TestTransportBodyRewindRace (0.44s)
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38227: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38227: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38227: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38227: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38227: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38227: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38227: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38227: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38227: connection error: PROTOCOL_ERROR
...
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38253: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38253: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38253: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38253: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38254: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38254: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38254: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38255: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 12:03:05 http2: server connection error from 127.0.0.1:38255: connection error: PROTOCOL_ERROR
    testing.go:1360: race detected during execution of test
2022-09-27 17:12 linux-amd64-race net@f4863917 go@d6ca2447 x/net/http2.TestTransportBodyRewindRace (log)
==================
WARNING: DATA RACE
Read at 0x00c00072c179 by goroutine 21444:
  net/http.rewindBody()
      /workdir/go/src/net/http/transport.go:667 +0x19b
  net/http.(*Transport).roundTrip()
      /workdir/go/src/net/http/transport.go:621 +0xeb1
  net/http.(*Transport).RoundTrip()
      /workdir/go/src/net/http/roundtrip.go:17 +0x36
  net/http.send()
...
--- FAIL: TestTransportBodyRewindRace (0.57s)
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60622: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60622: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60622: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60622: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60622: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60622: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60622: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60622: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60622: connection error: PROTOCOL_ERROR
...
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60972: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60982: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60982: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60982: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60982: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60982: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60990: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60990: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:28:10 http2: server connection error from 127.0.0.1:60990: connection error: PROTOCOL_ERROR
    testing.go:1372: race detected during execution of test
2022-09-27 17:12 linux-amd64-race net@f4863917 go@7f7f27f9 x/net/http2.TestTransportBodyRewindRace (log)
==================
WARNING: DATA RACE
Read at 0x00c000012611 by goroutine 21825:
  net/http.rewindBody()
      /workdir/go/src/net/http/transport.go:667 +0x19b
  net/http.(*Transport).roundTrip()
      /workdir/go/src/net/http/transport.go:621 +0xeb1
  net/http.(*Transport).RoundTrip()
      /workdir/go/src/net/http/roundtrip.go:17 +0x36
  net/http.send()
...
--- FAIL: TestTransportBodyRewindRace (0.57s)
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:51682: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:51682: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:51682: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:51682: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:51682: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:51682: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:51682: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:51682: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:51682: connection error: PROTOCOL_ERROR
...
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:52056: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:52056: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:52056: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:52066: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:52066: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:52066: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:52080: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:52080: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 17:07:21 http2: server connection error from 127.0.0.1:52084: connection error: PROTOCOL_ERROR
    testing.go:1360: race detected during execution of test
2022-09-27 17:12 linux-amd64-race net@f4863917 go@9d2c73a9 x/net/http2.TestTransportBodyRewindRace (log)
==================
WARNING: DATA RACE
Read at 0x00c0001e6671 by goroutine 129:
  net/http.rewindBody()
      /workdir/go/src/net/http/transport.go:663 +0x104
  net/http.(*Transport).roundTrip()
      /workdir/go/src/net/http/transport.go:620 +0xe71
  net/http.(*Transport).RoundTrip()
      /workdir/go/src/net/http/roundtrip.go:17 +0x36
  net/http.send()
...
--- FAIL: TestTransportBodyRewindRace (0.82s)
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60472: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60472: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60472: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60472: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60472: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60472: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60472: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60472: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60472: connection error: PROTOCOL_ERROR
...
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60780: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60780: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60790: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60790: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60790: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60790: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60802: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60802: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 16:46:44 http2: server connection error from 127.0.0.1:60816: connection error: PROTOCOL_ERROR
    testing.go:1312: race detected during execution of test
2022-09-27 17:12 linux-amd64-race net@f4863917 go@2614985e x/net/http2.TestTransportBodyRewindRace (log)
==================
WARNING: DATA RACE
Read at 0x00c00054c491 by goroutine 21691:
  net/http.rewindBody()
      /workdir/go/src/net/http/transport.go:667 +0x17b
  net/http.(*Transport).roundTrip()
      /workdir/go/src/net/http/transport.go:621 +0xeb1
  net/http.(*Transport).RoundTrip()
      /workdir/go/src/net/http/roundtrip.go:17 +0x36
  net/http.send()
...
--- FAIL: TestTransportBodyRewindRace (0.53s)
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:52838: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:52838: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:52838: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:52838: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:52838: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:52838: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:52838: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:52838: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:52838: connection error: PROTOCOL_ERROR
...
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:53090: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:53098: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:53098: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:53098: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:53098: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:53098: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:53114: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:53114: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/28 09:17:49 http2: server connection error from 127.0.0.1:53124: connection error: PROTOCOL_ERROR
    testing.go:1319: race detected during execution of test

watchflakes

@bcmills bcmills added this to the Go1.20 milestone Sep 30, 2022
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Sep 30, 2022
@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "golang.org/x/net/http2" && test == "TestTransportBodyRewindRace"
2022-09-27 17:12 freebsd-amd64-race net@f4863917 go@d7dbe011 x/net/http2.TestTransportBodyRewindRace (log)
==================
WARNING: DATA RACE
Read at 0x00c000290701 by goroutine 21650:
  net/http.rewindBody()
      /tmp/workdir/go/src/net/http/transport.go:667 +0x19b
  net/http.(*Transport).roundTrip()
      /tmp/workdir/go/src/net/http/transport.go:621 +0xeb1
  net/http.(*Transport).RoundTrip()
      /tmp/workdir/go/src/net/http/roundtrip.go:17 +0x36
  net/http.send()
...
--- FAIL: TestTransportBodyRewindRace (0.45s)
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53917: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53917: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53917: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53917: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53917: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53917: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53917: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53917: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53917: connection error: PROTOCOL_ERROR
...
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53944: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53944: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53944: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53945: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53945: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53945: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53946: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53946: connection error: PROTOCOL_ERROR
    http2_test.go:70: 2022/09/30 05:55:11 http2: server connection error from 127.0.0.1:53947: connection error: PROTOCOL_ERROR
    testing.go:1374: race detected during execution of test

watchflakes

@neild
Copy link
Contributor

neild commented Oct 4, 2022

Last set of flake reports predates the fix in https://go.dev/cl/435535.

WeiminShang added a commit to WeiminShang/net that referenced this issue Nov 16, 2022
Moving the Request.Body.Close call out from the ClientConn mutex
results in some cases where RoundTrip returns while the Close is
still in progress. This should be legal (RoundTrip explicitly allows
for this), but net/http relies on Close never being called after
RoundTrip returns.

Add additional synchronization to ensure Close calls complete
before RoundTrip returns.

Fixes golang/go#55896

Change-Id: Ie3d4773966745e83987d219927929cb56ec1a7ad
Reviewed-on: https://go-review.googlesource.com/c/net/+/435535
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Oct 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
Status: Done
Development

No branches or pull requests

4 participants