all: mutex's copied by value

Bug #1563628 reported by Dave Cheney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Undecided
Dave Cheney

Bug Description

lucky(~/src/github.com/juju/juju) % go vet ./... 2>&1 | grep Mutex
provider/gce/environ.go:139: assignment copies lock value to e: gce.environ contains sync.Mutex
provider/joyent/environ.go:129: assignment copies lock value to clone: joyent.joyentEnviron contains sync.Mutex
provider/lxd/environ.go:127: assignment copies lock value to e: lxd.environ contains sync.Mutex
provider/maas/storage_test.go:69: function call copies lock value: sync.Mutex
provider/maas/storage_test.go:69: function call copies lock value: sync.Mutex
provider/maas/storage_test.go:70: function call copies lock value: sync.Mutex
provider/maas/storage_test.go:70: function call copies lock value: sync.Mutex
provider/vsphere/environ.go:84: assignment copies lock value to e: vsphere.environ contains sync.Mutex
worker/metrics/sender/sender_test.go:286: eof passes lock by value: sender_test.mockConnection contains github.com/juju/testing.Stub contains sync.Mutex

A recent addition to go vet spots mutex's that are copied when the type they are embedded into are copied. This breaks the invariant.

Changed in juju-core:
assignee: nobody → Dave Cheney (dave-cheney)
Changed in juju-core:
status: New → In Progress
Changed in juju-core:
status: In Progress → Fix Committed
milestone: none → 2.0-beta4
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta4 → none
milestone: none → 2.0-beta4
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.