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

Issue 6571047: state: safer entity watchers

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by fwereade
Modified:
11 years, 7 months ago
Reviewers:
mp+126190
Visibility:
Public.

Description

state: safer entity watchers Entity watchers now always take a fresh copy of the entity to send down the channel. This is: * safer, because we're no longer sending the originating entity off down a channel to who-knows-where while still keeping the originating reference, potentially in use; * better, because it means that the initial event is a snapshot of *current* state, rather than just whatever state the Watch()ed entity had (which may be very out of date; in, for example the Uniter); the original behaviour would generate very unhelpful sequences of events. https://code.launchpad.net/~fwereade/juju-core/fix-entity-watchers/+merge/126190 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state: safer entity watchers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -8 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M state/service_test.go View 2 chunks +11 lines, -0 lines 0 comments Download
M state/unit_test.go View 2 chunks +10 lines, -0 lines 0 comments Download
M state/watcher.go View 6 chunks +10 lines, -8 lines 0 comments Download

Messages

Total messages: 4
fwereade
Please take a look.
11 years, 7 months ago (2012-09-25 08:32:01 UTC) #1
rog
On 2012/09/25 08:32:01, fwereade wrote: > Please take a look. LGTM++; i hadn't considered the ...
11 years, 7 months ago (2012-09-25 08:37:10 UTC) #2
TheMue
LGTM
11 years, 7 months ago (2012-09-25 08:38:49 UTC) #3
fwereade
11 years, 7 months ago (2012-09-25 08:56:34 UTC) #4
*** Submitted:

state: safer entity watchers

Entity watchers now always take a fresh copy of the entity to send down the
channel. This is:

* safer, because we're no longer sending the originating entity off down a
  channel to who-knows-where while still keeping the originating reference,
  potentially in use;
* better, because it means that the initial event is a snapshot of *current*
  state, rather than just whatever state the Watch()ed entity had (which may
  be very out of date; in, for example the Uniter); the original behaviour
  would generate very unhelpful sequences of events.

R=rog, TheMue
CC=
https://codereview.appspot.com/6571047
Sign in to reply to this message.

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