worker/peergrouper: fix data race #4836

Merged
merged 1 commit into from Mar 22, 2016

Conversation

Projects
None yet
2 participants
Contributor

davecheney commented Mar 22, 2016

Fixes LP 1560237

newWorker returns a reference to a *pgWorker value, but also passes that
reference to a goroutine which makes it unsafe to modify the contents of
the worker.

Work around this by explicitly passing the value of
providerSupportsSpaces into newWorker.

(Review request: http://reviews.vapour.ws/r/4277/)

worker/peergrouper: fix data race
newWorker returns a reference to a *pgWorker value, but also passes that
reference to a goroutine which makes it unsafe to modify the contents of
the worker.

Work around this by explicitly passing the value of
providerSupportsSpaces into newWorker.
Contributor

davecheney commented Mar 22, 2016

$$merge$$

Contributor

jujubot commented Mar 22, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request Mar 22, 2016

Merge pull request #4836 from davecheney/fixedbugs/1560237
worker/peergrouper: fix data race

Fixes LP 1560237

newWorker returns a reference to a *pgWorker value, but also passes that
reference to a goroutine which makes it unsafe to modify the contents of
the worker.

Work around this by explicitly passing the value of
providerSupportsSpaces into newWorker.

(Review request: http://reviews.vapour.ws/r/4277/)

@jujubot jujubot merged commit a4e4ce3 into juju:master Mar 22, 2016

@davecheney davecheney deleted the davecheney:fixedbugs/1560237 branch Mar 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment