We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
$ go version go version go1.12.2 darwin/amd64
Yes
go env
$ go env go env GOARCH="amd64" GOBIN="" GOCACHE="/Users/pmalek/Library/Caches/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/pmalek/.gvm/pkgsets/go1.12.2/global" GOPROXY="" GORACE="" GOROOT="/Users/pmalek/.gvm/gos/go1.12.2" GOTMPDIR="" GOTOOLDIR="/Users/pmalek/.gvm/gos/go1.12.2/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/Users/pmalek/code/project/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/zy/lzyp__pd7vx6762s5jcgkkl80000gn/T/go-build893261005=/tmp/go-build -gno-record-gcc-switches -fno-common"
Use http.Client concurrently
http.Client concurrently
// c.client initialized like so: // &http.Client{} var buf bytes.Buffer // write JSON to buff.... request, err := http.NewRequest("POST", url, &buf) if err != nil { return nil, err } request.SetBasicAuth(c.D, c.SessionKey) request.Header.Add("Content-type", "application/x-ldjson") rsp, err := c.client.Do(request)
No data race
================== WARNING: DATA RACE Read at 0x00c001112840 by goroutine 180: github.com/org/repo/project/someclient.(*SomeClient).SendStuff() /Users/pmalek/.gvm/gos/go1.12.2/src/bytes/buffer.go:68 +0xa63 github.com/org/repo/otherproject.(*replay).sendSomething.func1() /Users/pmalek/code/repo/project/directory/client.go:81 +0x1a52 Previous write at 0x00c001112840 by goroutine 138: bytes.(*Buffer).Read() /Users/pmalek/.gvm/gos/go1.12.2/src/bytes/buffer.go:101 +0xb5 io/ioutil.(*nopCloser).Read() <autogenerated>:1 +0x87 net/http.(*http2clientStream).writeRequestBody() /Users/pmalek/.gvm/gos/go1.12.2/src/net/http/h2_bundle.go:7664 +0x64d net/http.(*http2Transport).getBodyWriterState.func1() /Users/pmalek/.gvm/gos/go1.12.2/src/net/http/h2_bundle.go:8878 +0x13d Goroutine 180 (running) created at: github.com/org/repo/otherproject.(*replay).sendSomething() /Users/pmalek/code/repo/otherproject/replay.go:187 +0x6a5 Goroutine 138 (running) created at: net/http.http2bodyWriterState.scheduleBodyWrite() /Users/pmalek/.gvm/gos/go1.12.2/src/net/http/h2_bundle.go:8925 +0x12f net/http.(*http2ClientConn).roundTrip() /Users/pmalek/.gvm/gos/go1.12.2/src/net/http/h2_bundle.go:7465 +0x90f net/http.(*http2Transport).RoundTripOpt() /Users/pmalek/.gvm/gos/go1.12.2/src/net/http/h2_bundle.go:6867 +0x23d net/http.http2noDialH2RoundTripper.RoundTrip() /Users/pmalek/.gvm/gos/go1.12.2/src/net/http/h2_bundle.go:6829 +0x4c net/http.(*Transport).roundTrip() /Users/pmalek/.gvm/gos/go1.12.2/src/net/http/transport.go:430 +0x14d9 net/http.(*Transport).RoundTrip() /Users/pmalek/.gvm/gos/go1.12.2/src/net/http/roundtrip.go:17 +0x42 net/http.send() /Users/pmalek/.gvm/gos/go1.12.2/src/net/http/client.go:250 +0x6a9 net/http.(*Client).send() /Users/pmalek/.gvm/gos/go1.12.2/src/net/http/client.go:174 +0x1cb net/http.(*Client).do() /Users/pmalek/.gvm/gos/go1.12.2/src/net/http/client.go:641 +0x4ef github.com/org/repo/project/someclient.(*SomeClient).SendStuff() /Users/pmalek/.gvm/gos/go1.12.2/src/net/http/client.go:509 +0x4b7 github.com/org/repo/otherproject.(*replay).sendSomething.func1() /Users/pmalek/code/repo/project/directory/client.go:81 +0x1a52 ==================
The text was updated successfully, but these errors were encountered:
It seems that this is connected to (or even a duplicate of) #31192
Sorry, something went wrong.
Looking at the stack trace, that seems to be the case.
Duplicate of #31192
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Use
http.Client concurrently
What did you expect to see?
No data race
What did you see instead?
The text was updated successfully, but these errors were encountered: