data race in httpbakery

Bug #1752203 reported by Tim Penhey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

As found here:

http://10.125.0.203:8080/view/unit%20tests/job/RunUnittests-race-amd64/139/testReport/junit/github/com_juju_juju_api/TestAll/

WARNING: DATA RACE
Read at 0x00c42024db40 by goroutine 144:
  net/http.(*Request).closeBody()
      /snap/go/1404/src/net/http/request.go:1299 +0x44
  net/http.(*persistConn).writeLoop()
      /snap/go/1404/src/net/http/transport.go:1778 +0x42e

Previous write at 0x00c42024db40 by goroutine 139:
  gopkg.in/macaroon-bakery.v1/httpbakery.(*Client).setRequestBody()
      /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:397 +0x122
  gopkg.in/macaroon-bakery.v1/httpbakery.(*Client).doWithBody()
      /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:286 +0x377
  gopkg.in/macaroon-bakery.v1/httpbakery.(*Client).DoWithBodyAndCustomError()
      /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:245 +0x1af
  github.com/juju/juju/api.httpRequestDoer.DoWithBody()
      /workspace/src/github.com/juju/juju/api/http.go:94 +0x26f
  github.com/juju/httprequest.(*Client).Do()
      /workspace/src/github.com/juju/httprequest/client.go:178 +0x5f4
  github.com/juju/juju/api.(*Client).httpPost()
      /workspace/src/github.com/juju/juju/api/client.go:516 +0x15e
  github.com/juju/juju/api.(*Client).UploadCharm()
      /workspace/src/github.com/juju/juju/api/client.go:349 +0x68a
  github.com/juju/juju/api.(*Client).AddLocalCharm()
      /workspace/src/github.com/juju/juju/api/client.go:332 +0x58c
  github.com/juju/juju/api_test.(*clientMacaroonSuite).TestAddLocalCharmUnauthorized()
      /workspace/src/github.com/juju/juju/api/client_macaroon_test.go:81 +0x2d6
  runtime.call32()
      /snap/go/1404/src/runtime/asm_amd64.s:509 +0x3a
  reflect.Value.Call()
      /snap/go/1404/src/reflect/value.go:302 +0xc0
  gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1()
      /workspace/src/gopkg.in/check.v1/check.go:772 +0x9ab
  gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1()
      /workspace/src/gopkg.in/check.v1/check.go:666 +0x89

Goroutine 144 (running) created at:
  net/http.(*Transport).dialConn()
      /snap/go/1404/src/net/http/transport.go:1187 +0xbc9
  net/http.(*Transport).getConn.func4()
      /snap/go/1404/src/net/http/transport.go:943 +0xa2

Goroutine 139 (running) created at:
  gopkg.in/check%2ev1.(*suiteRunner).forkCall()
      /workspace/src/gopkg.in/check.v1/check.go:663 +0x430
  gopkg.in/check%2ev1.(*suiteRunner).forkTest()
      /workspace/src/gopkg.in/check.v1/check.go:754 +0x131
  gopkg.in/check%2ev1.(*suiteRunner).runTest()
      /workspace/src/gopkg.in/check.v1/check.go:809 +0x42
  gopkg.in/check%2ev1.(*suiteRunner).run()
      /workspace/src/gopkg.in/check.v1/check.go:615 +0x1fa
  gopkg.in/check%2ev1.Run()
      /workspace/src/gopkg.in/check.v1/run.go:92 +0x5a
  gopkg.in/check%2ev1.RunAll()
      /workspace/src/gopkg.in/check.v1/run.go:84 +0x136
  gopkg.in/check%2ev1.TestingT()
      /workspace/src/gopkg.in/check.v1/run.go:72 +0x680
  github.com/juju/testing.MgoTestPackage()
      /workspace/src/github.com/juju/testing/mgo.go:467 +0x120
  github.com/juju/juju/testing.MgoTestPackage()
      /workspace/src/github.com/juju/juju/testing/mgo.go:19 +0x41
  github.com/juju/juju/api_test.TestAll()
      /workspace/src/github.com/juju/juju/api/state_test.go:23 +0x38
  testing.tRunner()
      /snap/go/1404/src/testing/testing.go:746 +0x16c
==================
==================
WARNING: DATA RACE
Write at 0x00c4209a7920 by goroutine 144:
  sync/atomic.CompareAndSwapInt32()
      /snap/go/1404/src/runtime/race_amd64.s:293 +0xb
  sync.(*Mutex).Lock()
      /snap/go/1404/src/sync/mutex.go:74 +0x4d
  gopkg.in/macaroon-bakery.v1/httpbakery.(*readStopper).Close()
      /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:433 +0x3e
  net/http.(*Request).closeBody()
      /snap/go/1404/src/net/http/request.go:1300 +0x86
  net/http.(*persistConn).writeLoop()
      /snap/go/1404/src/net/http/transport.go:1778 +0x42e

Previous write at 0x00c4209a7920 by goroutine 139:
  gopkg.in/macaroon-bakery.v1/httpbakery.(*Client).setRequestBody()
      /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:398 +0xa6
  gopkg.in/macaroon-bakery.v1/httpbakery.(*Client).doWithBody()
      /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:286 +0x377
  gopkg.in/macaroon-bakery.v1/httpbakery.(*Client).DoWithBodyAndCustomError()
      /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:245 +0x1af
  github.com/juju/juju/api.httpRequestDoer.DoWithBody()
      /workspace/src/github.com/juju/juju/api/http.go:94 +0x26f
  github.com/juju/httprequest.(*Client).Do()
      /workspace/src/github.com/juju/httprequest/client.go:178 +0x5f4
  github.com/juju/juju/api.(*Client).httpPost()
      /workspace/src/github.com/juju/juju/api/client.go:516 +0x15e
  github.com/juju/juju/api.(*Client).UploadCharm()
      /workspace/src/github.com/juju/juju/api/client.go:349 +0x68a
  github.com/juju/juju/api.(*Client).AddLocalCharm()
      /workspace/src/github.com/juju/juju/api/client.go:332 +0x58c
  github.com/juju/juju/api_test.(*clientMacaroonSuite).TestAddLocalCharmUnauthorized()
      /workspace/src/github.com/juju/juju/api/client_macaroon_test.go:81 +0x2d6
  runtime.call32()
      /snap/go/1404/src/runtime/asm_amd64.s:509 +0x3a
  reflect.Value.Call()
      /snap/go/1404/src/reflect/value.go:302 +0xc0
  gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1()
      /workspace/src/gopkg.in/check.v1/check.go:772 +0x9ab
  gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1()
      /workspace/src/gopkg.in/check.v1/check.go:666 +0x89

Goroutine 144 (running) created at:
  net/http.(*Transport).dialConn()
      /snap/go/1404/src/net/http/transport.go:1187 +0xbc9
  net/http.(*Transport).getConn.func4()
      /snap/go/1404/src/net/http/transport.go:943 +0xa2

Goroutine 139 (running) created at:
  gopkg.in/check%2ev1.(*suiteRunner).forkCall()
      /workspace/src/gopkg.in/check.v1/check.go:663 +0x430
  gopkg.in/check%2ev1.(*suiteRunner).forkTest()
      /workspace/src/gopkg.in/check.v1/check.go:754 +0x131
  gopkg.in/check%2ev1.(*suiteRunner).runTest()
      /workspace/src/gopkg.in/check.v1/check.go:809 +0x42
  gopkg.in/check%2ev1.(*suiteRunner).run()
      /workspace/src/gopkg.in/check.v1/check.go:615 +0x1fa
  gopkg.in/check%2ev1.Run()
      /workspace/src/gopkg.in/check.v1/run.go:92 +0x5a
  gopkg.in/check%2ev1.RunAll()
      /workspace/src/gopkg.in/check.v1/run.go:84 +0x136
  gopkg.in/check%2ev1.TestingT()
      /workspace/src/gopkg.in/check.v1/run.go:72 +0x680
  github.com/juju/testing.MgoTestPackage()
      /workspace/src/github.com/juju/testing/mgo.go:467 +0x120
  github.com/juju/juju/testing.MgoTestPackage()
      /workspace/src/github.com/juju/juju/testing/mgo.go:19 +0x41
  github.com/juju/juju/api_test.TestAll()
      /workspace/src/github.com/juju/juju/api/state_test.go:23 +0x38
  testing.tRunner()
      /snap/go/1404/src/testing/testing.go:746 +0x16c
==================
==================
WARNING: DATA RACE
Write at 0x00c4209a7928 by goroutine 144:
  gopkg.in/macaroon-bakery.v1/httpbakery.(*readStopper).Close()
      /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:434 +0x50
  net/http.(*Request).closeBody()
      /snap/go/1404/src/net/http/request.go:1300 +0x86
  net/http.(*persistConn).writeLoop()
      /snap/go/1404/src/net/http/transport.go:1778 +0x42e

Previous write at 0x00c4209a7928 by goroutine 139:
  gopkg.in/macaroon-bakery.v1/httpbakery.(*Client).setRequestBody()
      /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:398 +0xa6
  gopkg.in/macaroon-bakery.v1/httpbakery.(*Client).doWithBody()
      /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:286 +0x377
  gopkg.in/macaroon-bakery.v1/httpbakery.(*Client).DoWithBodyAndCustomError()
      /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:245 +0x1af
  github.com/juju/juju/api.httpRequestDoer.DoWithBody()
      /workspace/src/github.com/juju/juju/api/http.go:94 +0x26f
  github.com/juju/httprequest.(*Client).Do()
      /workspace/src/github.com/juju/httprequest/client.go:178 +0x5f4
  github.com/juju/juju/api.(*Client).httpPost()
      /workspace/src/github.com/juju/juju/api/client.go:516 +0x15e
  github.com/juju/juju/api.(*Client).UploadCharm()
      /workspace/src/github.com/juju/juju/api/client.go:349 +0x68a
  github.com/juju/juju/api.(*Client).AddLocalCharm()
      /workspace/src/github.com/juju/juju/api/client.go:332 +0x58c
  github.com/juju/juju/api_test.(*clientMacaroonSuite).TestAddLocalCharmUnauthorized()
      /workspace/src/github.com/juju/juju/api/client_macaroon_test.go:81 +0x2d6
  runtime.call32()
      /snap/go/1404/src/runtime/asm_amd64.s:509 +0x3a
  reflect.Value.Call()
      /snap/go/1404/src/reflect/value.go:302 +0xc0
  gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1()
      /workspace/src/gopkg.in/check.v1/check.go:772 +0x9ab
  gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1()
      /workspace/src/gopkg.in/check.v1/check.go:666 +0x89

Goroutine 144 (running) created at:
  net/http.(*Transport).dialConn()
      /snap/go/1404/src/net/http/transport.go:1187 +0xbc9
  net/http.(*Transport).getConn.func4()
      /snap/go/1404/src/net/http/transport.go:943 +0xa2

Goroutine 139 (running) created at:
  gopkg.in/check%2ev1.(*suiteRunner).forkCall()
      /workspace/src/gopkg.in/check.v1/check.go:663 +0x430
  gopkg.in/check%2ev1.(*suiteRunner).forkTest()
      /workspace/src/gopkg.in/check.v1/check.go:754 +0x131
  gopkg.in/check%2ev1.(*suiteRunner).runTest()
      /workspace/src/gopkg.in/check.v1/check.go:809 +0x42
  gopkg.in/check%2ev1.(*suiteRunner).run()
      /workspace/src/gopkg.in/check.v1/check.go:615 +0x1fa
  gopkg.in/check%2ev1.Run()
      /workspace/src/gopkg.in/check.v1/run.go:92 +0x5a
  gopkg.in/check%2ev1.RunAll()
      /workspace/src/gopkg.in/check.v1/run.go:84 +0x136
  gopkg.in/check%2ev1.TestingT()
      /workspace/src/gopkg.in/check.v1/run.go:72 +0x680
  github.com/juju/testing.MgoTestPackage()
      /workspace/src/github.com/juju/testing/mgo.go:467 +0x120
  github.com/juju/juju/testing.MgoTestPackage()
      /workspace/src/github.com/juju/juju/testing/mgo.go:19 +0x41
  github.com/juju/juju/api_test.TestAll()
      /workspace/src/github.com/juju/juju/api/state_test.go:23 +0x38
  testing.tRunner()
      /snap/go/1404/src/testing/testing.go:746 +0x16c
==================
OK: 109 passed, 1 skipped
 testing.go:699: race detected during execution of test

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1752203] [NEW] data race in httpbakery
Download full text (11.3 KiB)

This seems to be another case of it:
  http://10.125.0.203:8080/job/RunUnittests-race-amd64/147/console

On Wed, Feb 28, 2018 at 4:44 AM, Tim Penhey <email address hidden>
wrote:

> Public bug reported:
>
> As found here:
>
> http://10.125.0.203:8080/view/unit%20tests/job/RunUnittests-race-
> amd64/139/testReport/junit/github/com_juju_juju_api/TestAll/
>
>
> WARNING: DATA RACE
> Read at 0x00c42024db40 by goroutine 144:
> net/http.(*Request).closeBody()
> /snap/go/1404/src/net/http/request.go:1299 +0x44
> net/http.(*persistConn).writeLoop()
> /snap/go/1404/src/net/http/transport.go:1778 +0x42e
>
> Previous write at 0x00c42024db40 by goroutine 139:
> gopkg.in/macaroon-bakery.v1/httpbakery.(*Client).setRequestBody()
> /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:397
> +0x122
> gopkg.in/macaroon-bakery.v1/httpbakery.(*Client).doWithBody()
> /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:286
> +0x377
> gopkg.in/macaroon-bakery.v1/httpbakery.(*Client).
> DoWithBodyAndCustomError()
> /workspace/src/gopkg.in/macaroon-bakery.v1/httpbakery/client.go:245
> +0x1af
> github.com/juju/juju/api.httpRequestDoer.DoWithBody()
> /workspace/src/github.com/juju/juju/api/http.go:94 +0x26f
> github.com/juju/httprequest.(*Client).Do()
> /workspace/src/github.com/juju/httprequest/client.go:178 +0x5f4
> github.com/juju/juju/api.(*Client).httpPost()
> /workspace/src/github.com/juju/juju/api/client.go:516 +0x15e
> github.com/juju/juju/api.(*Client).UploadCharm()
> /workspace/src/github.com/juju/juju/api/client.go:349 +0x68a
> github.com/juju/juju/api.(*Client).AddLocalCharm()
> /workspace/src/github.com/juju/juju/api/client.go:332 +0x58c
> github.com/juju/juju/api_test.(*clientMacaroonSuite).
> TestAddLocalCharmUnauthorized()
> /workspace/src/github.com/juju/juju/api/client_macaroon_test.go:81
> +0x2d6
> runtime.call32()
> /snap/go/1404/src/runtime/asm_amd64.s:509 +0x3a
> reflect.Value.Call()
> /snap/go/1404/src/reflect/value.go:302 +0xc0
> gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1()
> /workspace/src/gopkg.in/check.v1/check.go:772 +0x9ab
> gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1()
> /workspace/src/gopkg.in/check.v1/check.go:666 +0x89
>
> Goroutine 144 (running) created at:
> net/http.(*Transport).dialConn()
> /snap/go/1404/src/net/http/transport.go:1187 +0xbc9
> net/http.(*Transport).getConn.func4()
> /snap/go/1404/src/net/http/transport.go:943 +0xa2
>
> Goroutine 139 (running) created at:
> gopkg.in/check%2ev1.(*suiteRunner).forkCall()
> /workspace/src/gopkg.in/check.v1/check.go:663 +0x430
> gopkg.in/check%2ev1.(*suiteRunner).forkTest()
> /workspace/src/gopkg.in/check.v1/check.go:754 +0x131
> gopkg.in/check%2ev1.(*suiteRunner).runTest()
> /workspace/src/gopkg.in/check.v1/check.go:809 +0x42
> gopkg.in/check%2ev1.(*suiteRunner).run()
> /workspace/src/gopkg.in/check.v1/check.go:615 +0x1fa
> gopkg.in/check%2ev1.Run()
> /workspace/src/gopkg.in/check.v1/run.go:92 +0x5a
> gopkg.in/check%2ev1.RunAll()
> /workspace/src/gopkg.in/check.v1/run...

Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Medium → Low
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.