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

net/http: data race on Request.Method #3881

Closed
dvyukov opened this issue Jul 28, 2012 · 2 comments
Closed

net/http: data race on Request.Method #3881

dvyukov opened this issue Jul 28, 2012 · 2 comments

Comments

@dvyukov
Copy link
Member

dvyukov commented Jul 28, 2012

On a proprietary test ThreadSanitizer says:

WARNING: DATA RACE at 0x00004020eb40
Write by goroutine 32:
  net/http.ReadResponse()
      src/pkg/net/http/response.go:110 +0x13c
  net/http.(*persistConn).readLoop()
      src/pkg/net/http/transport.go:564 +0x3f8
Previous read by goroutine 33:
  net/http.(*Request).write()
      src/pkg/net/http/request.go:321 +0xb81
  net/http.(*persistConn).writeLoop()
      src/pkg/net/http/transport.go:641 +0x231
Goroutine 32 (running) created at:
  net/http.(*Transport).getConn()
      src/pkg/net/http/transport.go:390 +0x769
  net/http.(*Transport).RoundTrip()
      src/pkg/net/http/transport.go:156 +0x31e
  net/http.send()
      src/pkg/net/http/client.go:141 +0x4e1
  net/http.(*Client).doFollowingRedirects()
      src/pkg/net/http/client.go:254 +0x8d8
  net/http.(*Client).Get()
      src/pkg/net/http/client.go:201 +0xc1
  net/http.Get()
      src/pkg/net/http/client.go:178 +0x55
  ...
  testing.tRunner()
      src/pkg/testing/testing.go:292 +0xb6
Goroutine 33 (running) created at:
  net/http.(*Transport).getConn()
      src/pkg/net/http/transport.go:391 +0x780
  net/http.(*Transport).RoundTrip()
      src/pkg/net/http/transport.go:156 +0x31e
  net/http.send()
      src/pkg/net/http/client.go:141 +0x4e1
  net/http.(*Client).doFollowingRedirects()
      src/pkg/net/http/client.go:254 +0x8d8
  net/http.(*Client).Get()
      src/pkg/net/http/client.go:201 +0xc1
  net/http.Get()
      src/pkg/net/http/client.go:178 +0x55
  ...
  testing.tRunner()
      src/pkg/testing/testing.go:292 +0xb6

During invocation of RoundTrip() string field Request.Method is concurrently read and
mutated.
@bradfitz
Copy link
Contributor

Comment 1:

http://golang.org/cl/6446063

Status changed to Started.

@bradfitz
Copy link
Contributor

Comment 2:

This issue was closed by revision f8c6514.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants