Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
api: fix data race in Client.AddLocalCharm #2618
Conversation
|
yuck. nice solution though. |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Generating tarball failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
added a commit
that referenced
this pull request
Jun 22, 2015
jujubot
merged commit 2e038f4
into
juju:master
Jun 22, 2015
davecheney
deleted the
davecheney:fixedbugs/1465115
branch
Jun 22, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
davecheney commentedJun 22, 2015
Updates LP 1465115
A data race exists because the Client holds a reference to the charm bundle file descriptor and closes it unconditionally on the way out of the method.
However, the net/http Client also has a reference to the file descriptor via the http request body and also closes it if the upload is successful.
It is not clear if the body will be closed if the request is not successful.
This creates a race on the Close method which is not safe to be called by multiple goroutines. Work around this by inserting a wrapper which nullifies the Close method presented to the http Client.
(Review request: http://reviews.vapour.ws/r/1992/)