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

Issue 6354045: add presence.ChildrenWatcher

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

Description

add presence.ChildrenWatcher This mimics watcher.ChildrenWatcher, but expects that all children be presence nodes; and notifies of child node Pinger life/death, rather than mere existence of child nodes. This is now much closer to the original proposal, but hopefully with less apparent crack-related influences, and abandons the somewhat optimistic (read: almost entirely composed of weapons-grade crack) attempt to make the childLoop goroutines responsible for their own cleanup. Original Cl at: https://codereview.appspot.com/6335057/ (CL changed for dull prereq-related reasons). https://code.launchpad.net/~fwereade/juju-core/watch-presence-children/+merge/112375 Requires: https://code.launchpad.net/~fwereade/juju-core/consolidate-content-watchers/+merge/112350 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 11

Patch Set 2 : add presence.ChildrenWatcher #

Patch Set 3 : add presence.ChildrenWatcher #

Total comments: 21

Patch Set 4 : add presence.ChildrenWatcher #

Patch Set 5 : add presence.ChildrenWatcher #

Patch Set 6 : add presence.ChildrenWatcher #

Total comments: 5

Patch Set 7 : add presence.ChildrenWatcher #

Unified diffs Side-by-side diffs Delta from patch set Stats (+276 lines, -1 line) Patch
D .lbox View 1 chunk +0 lines, -1 line 0 comments Download
A [revision details] View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M state/presence/presence.go View 1 2 3 4 5 6 2 chunks +182 lines, -0 lines 0 comments Download
M state/presence/presence_test.go View 1 2 1 chunk +92 lines, -0 lines 0 comments Download

Messages

Total messages: 12
fwereade
Please take a look.
11 years, 9 months ago (2012-06-27 15:01:12 UTC) #1
niemeyer
https://codereview.appspot.com/6354045/diff/1/.lbox File .lbox (left): https://codereview.appspot.com/6354045/diff/1/.lbox#oldcode1 .lbox:1: propose -cr -for lp:juju-core Oops. We still want this. ...
11 years, 9 months ago (2012-06-28 06:48:49 UTC) #2
fwereade
On closer inspection it appears that a lot of this proposal is complete nonsense. Sorry ...
11 years, 9 months ago (2012-06-28 10:37:39 UTC) #3
fwereade
Please take a look.
11 years, 9 months ago (2012-07-13 19:27:53 UTC) #4
fwereade
Please take a look.
11 years, 9 months ago (2012-07-16 10:04:05 UTC) #5
dfc
http://codereview.appspot.com/6354045/diff/10001/state/presence/presence.go File state/presence/presence.go (right): http://codereview.appspot.com/6354045/diff/10001/state/presence/presence.go#newcode444 state/presence/presence.go:444: case w.changes <- change: Should change be set to ...
11 years, 9 months ago (2012-07-17 00:56:22 UTC) #6
fwereade
http://codereview.appspot.com/6354045/diff/10001/state/presence/presence.go File state/presence/presence.go (right): http://codereview.appspot.com/6354045/diff/10001/state/presence/presence.go#newcode444 state/presence/presence.go:444: case w.changes <- change: On 2012/07/17 00:56:22, dfc wrote: ...
11 years, 9 months ago (2012-07-17 15:04:47 UTC) #7
niemeyer
https://codereview.appspot.com/6354045/diff/10001/state/presence/presence.go File state/presence/presence.go (right): https://codereview.appspot.com/6354045/diff/10001/state/presence/presence.go#newcode96 state/presence/presence.go:96: next := p.lastPing.Add(p.period) Why is a pinger change being ...
11 years, 9 months ago (2012-07-17 15:12:22 UTC) #8
fwereade
Please take a look. https://codereview.appspot.com/6354045/diff/10001/state/presence/presence.go File state/presence/presence.go (right): https://codereview.appspot.com/6354045/diff/10001/state/presence/presence.go#newcode96 state/presence/presence.go:96: next := p.lastPing.Add(p.period) On 2012/07/17 ...
11 years, 9 months ago (2012-07-18 08:53:45 UTC) #9
fwereade
Please take a look.
11 years, 9 months ago (2012-07-18 09:29:47 UTC) #10
niemeyer
LGTM! A couple of details for your consideration: https://codereview.appspot.com/6354045/diff/3002/state/presence/presence.go File state/presence/presence.go (right): https://codereview.appspot.com/6354045/diff/3002/state/presence/presence.go#newcode456 state/presence/presence.go:456: close(w.updates) ...
11 years, 9 months ago (2012-07-19 00:03:26 UTC) #11
fwereade
11 years, 9 months ago (2012-07-19 07:17:02 UTC) #12
*** Submitted:

add presence.ChildrenWatcher

This mimics watcher.ChildrenWatcher, but expects that all children be
presence nodes; and notifies of child node Pinger life/death, rather
than mere existence of child nodes.

This is now much closer to the original proposal, but hopefully with less
apparent crack-related influences, and abandons the somewhat optimistic
(read: almost entirely composed of weapons-grade crack) attempt to make
the childLoop goroutines responsible for their own cleanup.

Original Cl at: https://codereview.appspot.com/6335057/ (CL changed for dull
prereq-related reasons).

R=niemeyer, dfc
CC=
https://codereview.appspot.com/6354045

https://codereview.appspot.com/6354045/diff/3002/state/presence/presence.go
File state/presence/presence.go (right):

https://codereview.appspot.com/6354045/diff/3002/state/presence/presence.go#n...
state/presence/presence.go:456: close(w.updates)
On 2012/07/19 00:03:26, niemeyer wrote:
> Why was this added? There's apparently no benefit in closing this channel.

The benefits is nebulous, philosophical, and arguable -- that synchronous
shutdown is a good thing, and that a maintainer who breaks it accidentally will
be informed of that by the panics, while one who's analysed the type properly
and determined that fuzzy shutdown is reasonable (which, to be fair, it actually
is; but who knows what will change) will have deleted this line deliberately.
The downside ofc is that the maintainer might break it and *not* see it while
running the tests, and end up screwing up live environments.

I'll drop it for now, let me know if you're slightly swayed by the above idea
and I'll put it back in as a trivial.

https://codereview.appspot.com/6354045/diff/3002/state/presence/presence.go#n...
state/presence/presence.go:520: // and we should remain silent and just wait for
the watch.
On 2012/07/19 00:03:26, niemeyer wrote:
> This seems a bit confusing, and is basically restating what was just said
above
> in a different way. I suggest dropping it.

Done.
Sign in to reply to this message.

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