Skip to content

net/http: test race on linux/amd64 trybot #17868

Closed
@cespare

Description

@cespare

I see a race on the linux-amd64-race trybot running over some unrelated code (CL 32923):

https://storage.googleapis.com/go-build-log/17537d3e/linux-amd64-race_d3fd3644.log

I see that there are some recent test-flake-related commits in net/http but I cannot reproduce the race locally within a few test -race runs so I don't know whether it's fixed or not.

==================
WARNING: DATA RACE
Write at 0x00c420c44080 by goroutine 426:
  net/http.(*http2serverConn).newWriterAndRequestNoBody()
      /tmp/workdir/go/src/net/http/h2_bundle.go:4479 +0xaa4
  net/http.(*http2serverConn).newWriterAndRequest()
      /tmp/workdir/go/src/net/http/h2_bundle.go:4382 +0x4cc
  net/http.(*http2serverConn).processHeaders()
      /tmp/workdir/go/src/net/http/h2_bundle.go:4240 +0x4ac
  net/http.(*http2serverConn).processFrame()
      /tmp/workdir/go/src/net/http/h2_bundle.go:3930 +0x4d9
  net/http.(*http2serverConn).processFrameFromReader()
      /tmp/workdir/go/src/net/http/h2_bundle.go:3889 +0x8af
  net/http.(*http2serverConn).serve()
      /tmp/workdir/go/src/net/http/h2_bundle.go:3527 +0xacf
  net/http.(*http2Server).ServeConn()
      /tmp/workdir/go/src/net/http/h2_bundle.go:3166 +0xc82
  net/http.http2ConfigureServer.func1()
      /tmp/workdir/go/src/net/http/h2_bundle.go:3048 +0xe7
  net/http.(*conn).serve()
      /tmp/workdir/go/src/net/http/server.go:1709 +0x1952

Previous read at 0x00c420c44080 by goroutine 355:
  [failed to restore the stack]

Goroutine 426 (running) created at:
  net/http.(*Server).Serve()
      /tmp/workdir/go/src/net/http/server.go:2608 +0x35f
  net/http/httptest.(*Server).goServe.func1()
      /tmp/workdir/go/src/net/http/httptest/server.go:236 +0xa2

Goroutine 355 (finished) created at:
  net/http.(*http2responseWriter).CloseNotify()
      /tmp/workdir/go/src/net/http/h2_bundle.go:4932 +0x129
  net/http_test.testTransportAndServerSharedBodyRace.func2()
      /tmp/workdir/go/src/net/http/serve_test.go:3362 +0x93
  net/http.HandlerFunc.ServeHTTP()
      /tmp/workdir/go/src/net/http/server.go:1895 +0x51
  net/http.serverHandler.ServeHTTP()
      /tmp/workdir/go/src/net/http/server.go:2508 +0xbc
  net/http.initNPNRequest.ServeHTTP()
      /tmp/workdir/go/src/net/http/server.go:3028 +0x109
  net/http.(*initNPNRequest).ServeHTTP()
      <autogenerated>:318 +0x98
  net/http.(Handler).ServeHTTP-fm()
      /tmp/workdir/go/src/net/http/h2_bundle.go:4251 +0x64
  net/http.(*http2serverConn).runHandler()
      /tmp/workdir/go/src/net/http/h2_bundle.go:4529 +0x96
==================

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions