Skip to content

net/http: data race reading a "Expect: 100-Continue" request while writing response #13050

Closed
@linkdata

Description

@linkdata

The goroutine reading the request body will be updating "ecr.sawEOF", while the goroutine writing the response will be reading that boolean with no synchronization.

Using go1.5.1 windows/amd64.

WARNING: DATA RACE
Read by goroutine 438:
  net/http.(*chunkWriter).writeHeader()
      C:/workdir/go/src/net/http/server.go:866 +0xe38
  net/http.(*chunkWriter).Write()
      C:/workdir/go/src/net/http/server.go:261 +0xbf
  bufio.(*Writer).Write()
      C:/workdir/go/src/bufio/bufio.go:594 +0x17b
  net/http.(*response).write()
      C:/workdir/go/src/net/http/server.go:1140 +0x316
  net/http.(*response).Write()
      C:/workdir/go/src/net/http/server.go:1112 +0x7f
  (...app...)

Previous write by goroutine 870:
  net/http.(*expectContinueReader).Read()
      C:/workdir/go/src/net/http/server.go:571 +0x351
  (...app...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions