Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(222)

Issue 10602043: Document locking concerns around SetConfig. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 8 months ago by jtv.canonical
Modified:
12 years, 6 months ago
Reviewers:
mp+171494, mue, jameinel, rog
Visibility:
Public.

Description

Document locking concerns around SetConfig. Based on an email exchange where Roger Peppe provided helpful information. Here are the parts on which I based the documentation change: > Do we want consistent images of an environ and its config, so that a > provider operation concurrent with a config change doesn't get a view > that's nonsensical in some way? Or are the locks just there to prevent > undefined behaviour at the language level? The locks are there principally for the latter, yes, because in general we allow methods to be called concurrently on an Environ and allowing concurrent access to fields invokes undefined behaviour. > When we release an environment's lock between reading multiple > attributes, is there a risk of reconfiguration happening inbetween, and > do we mind? It'd be great to have the reasons explicit in the code. In the most general case, there is such a risk, but we take care not to share an Environ between concurrent workers, so any individual worker can decide whether it is appropriate to call a method or function which may call SetConfig (it's free to use a mutex itself if it needs to). There are a few more such places than there used to be (environs.FindBootstrapTools and environs.EnsureCertificate being two), so it's definitely worth being aware of this potential issue. https://code.launchpad.net/~jtv/juju-core/locking-comment/+merge/171494 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -1 line) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M environs/interface.go View 1 chunk +8 lines, -1 line 1 comment Download

Messages

Total messages: 5
jtv.canonical
Please take a look.
12 years, 8 months ago (2013-06-26 09:35:24 UTC) #1
jameinel
LGTM
12 years, 8 months ago (2013-06-26 10:11:49 UTC) #2
mue
LGTM
12 years, 8 months ago (2013-06-26 11:05:23 UTC) #3
rog
LGTM with one suggestion. https://codereview.appspot.com/10602043/diff/1/environs/interface.go File environs/interface.go (right): https://codereview.appspot.com/10602043/diff/1/environs/interface.go#newcode131 environs/interface.go:131: // Even though Juju takes ...
12 years, 8 months ago (2013-06-26 11:23:23 UTC) #4
jtv.canonical
12 years, 8 months ago (2013-06-26 13:20:10 UTC) #5
Thanks.  I moved that paragraph to the comment for Environ itself.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b