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

Issue 6336058: state: fixed FlagWatcher to not fire when only content is changed (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 4 months ago by TheMue
Modified:
12 years, 4 months ago
Reviewers:
mp+112065
Visibility:
Public.

Description

state: fixed FlagWatcher to not fire when only content is changed The first version of the FlagWatcher also fired events when the content of the watched node has been changed. Even if this usage is not the intention of the FlagWatcher (it only has to watch for the creation and deletion of nodes) this is an unwanted behavior. After the fix it only looks for existence changes. https://code.launchpad.net/~themue/juju-core/go-state-flag-watcher-fix/+merge/112065 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state: fixed FlagWatcher to not fire when only content is changed #

Total comments: 2

Patch Set 3 : state: fixed FlagWatcher to not fire when only content is changed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -48 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M state/watcher.go View 2 chunks +10 lines, -0 lines 0 comments Download
M state/watcher_test.go View 1 2 20 chunks +93 lines, -48 lines 0 comments Download

Messages

Total messages: 6
TheMue
Please take a look.
12 years, 4 months ago (2012-06-26 10:56:53 UTC) #1
fwereade
The change is good, but I'd prefer it if we had a test that exercised ...
12 years, 4 months ago (2012-06-26 10:58:58 UTC) #2
TheMue
Please take a look.
12 years, 4 months ago (2012-06-26 15:21:28 UTC) #3
fwereade
LGTM
12 years, 4 months ago (2012-06-26 15:42:53 UTC) #4
niemeyer
LGTM, with a minor. https://codereview.appspot.com/6336058/diff/4001/state/watcher_test.go File state/watcher_test.go (right): https://codereview.appspot.com/6336058/diff/4001/state/watcher_test.go#newcode145 state/watcher_test.go:145: err = exposedWatcher.Stop() It's fine ...
12 years, 4 months ago (2012-06-27 00:15:52 UTC) #5
TheMue
12 years, 4 months ago (2012-06-27 08:46:02 UTC) #6
*** Submitted:

state: fixed FlagWatcher to not fire when only content is changed

The first version of the FlagWatcher also fired events when the
content of the watched node has been changed. Even if this usage
is not the intention of the FlagWatcher (it only has to watch for
the creation and deletion of nodes) this is an unwanted behavior.
After the fix it only looks for existence changes.

R=fwereade, niemeyer
CC=
https://codereview.appspot.com/6336058

https://codereview.appspot.com/6336058/diff/4001/state/watcher_test.go
File state/watcher_test.go (right):

https://codereview.appspot.com/6336058/diff/4001/state/watcher_test.go#newcod...
state/watcher_test.go:145: err = exposedWatcher.Stop()
On 2012/06/27 00:15:52, niemeyer wrote:
> It's fine to do this here, but this must also be deferred after it's created,
> otherwise any assertion failing above leaves things running in background.
> 
> I see there is the same problem in other tests. Can you please take the chance
> to fix them too?

Done.
Sign in to reply to this message.

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