DescriptionAdd config-related methods in the Azure provider.
You'll notice that the locking in our Environ implementation is different from
what the other providers do. The other providers do it like this:
* For read-only access to the Environ object, use the locking getter methods.
* For read-write access, lock the object and access its attributes directly.
We found this a little error-prone: it's easy to forget to use a getter
(leading to a subtle concurrency bug), or to use one when you shouldn't
(leading to a deadlock panic), or to risk seeing an inconsistent view of the
object (by calling one locking getter and then another — the object may have
changed in the meantime).
So instead we have a method that creates atomic ("snapshot") copies of an
Environ object. You can do all you like with your copy, because it has no
effect on the original. Use of the snapshot goes like:
* For read-only access to the Environ object, obtain a snapshot. Access
its attributes directly.
* For read-write access, lock the object. Access its attributes directly.
https://code.launchpad.net/~rvb/juju-core/az-config-items2/+merge/169759
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 1
MessagesTotal messages: 3
|