DescriptionAdd VersionWatcher type (for unitRelationWatcher)
I am still concerned that we're doing a lot of unnecessary work for benefits
I can't see. As succinctly as possible:
* we are notified of a settings change.
* we discard the actual data and retain only the version.
* we thereby create potential state "changes" that aren't actual changes (
IIRC ConfigNode prevents non-changes from actually being written, but I
don't really like implicitly depending on that sort of property of
distant code).
* when we come to execute hooks in response to that change, we look up that
data again (which is now out of sequence wrt the relation membership).
* we also cache that out-of-sequence data to prevent us from seeing more
changes midway through hook execution (but the settings of individual
nodes are cached individually at the time they're first accessed, so the
relation membership, and the settings of every node accessed during hook
execution, are all potentially out of sync).
I accept that the out-of-sequence-ness doesn't really matter much -- and
that after enough changes we'll always hit the same steady state -- but it
seems to me that the above strategy is actually a lot more work, and harder
to follow, than the following:
* we are notified of a settings change
* we store the settings
* when running a hook in response to the change, we use the recorded
settings
I would greatly appreciate a succinct explanation of the benefits of the
first approach over the second, because I still don't see what we (or the
charm writers) gain in exchange for all the extra code and complexity; this
would make me feel a lot more comfortable about the path down which this CL
is the first step.
https://code.launchpad.net/~fwereade/juju-core/version-watcher/+merge/111158
(do not edit description out of merge proposal)
Patch Set 1 #Patch Set 2 : Add VersionWatcher type (for unitRelationWatcher) #
MessagesTotal messages: 5
|