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

Issue 10298043: uniter: don't repeat change events

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

Description

uniter: don't repeat change events By putting the unit.ClearResolved onto the filter goroutine, and immediately forcing unit-change handling, we can ensure that the uniter goroutine cannot request a fresh resolved event before the filter has refreshed the unit and determined that there is no event to deliver. https://code.launchpad.net/~fwereade/juju-core/uniter-no-repeat-resolved/+merge/169618 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -17 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M worker/uniter/filter.go View 6 chunks +51 lines, -5 lines 4 comments Download
M worker/uniter/filter_test.go View 1 chunk +20 lines, -10 lines 0 comments Download
M worker/uniter/modes.go View 2 chunks +2 lines, -2 lines 0 comments Download
M worker/uniter/uniter_test.go View 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 4
fwereade
Please take a look.
10 years, 11 months ago (2013-06-15 11:48:45 UTC) #1
dave_cheney.net
LGTM. Thank you. https://codereview.appspot.com/10298043/diff/1/worker/uniter/filter.go File worker/uniter/filter.go (right): https://codereview.appspot.com/10298043/diff/1/worker/uniter/filter.go#newcode104 worker/uniter/filter.go:104: didSetCharm: make(chan struct{}), i see below ...
10 years, 11 months ago (2013-06-17 07:45:42 UTC) #2
mue
LGTM, only small comment. https://codereview.appspot.com/10298043/diff/1/worker/uniter/filter.go File worker/uniter/filter.go (right): https://codereview.appspot.com/10298043/diff/1/worker/uniter/filter.go#newcode104 worker/uniter/filter.go:104: didSetCharm: make(chan struct{}), On 2013/06/17 ...
10 years, 11 months ago (2013-06-18 10:50:25 UTC) #3
fwereade
10 years, 11 months ago (2013-06-19 13:14:27 UTC) #4
https://codereview.appspot.com/10298043/diff/1/worker/uniter/filter.go
File worker/uniter/filter.go (right):

https://codereview.appspot.com/10298043/diff/1/worker/uniter/filter.go#newcod...
worker/uniter/filter.go:104: didSetCharm:       make(chan struct{}),
On 2013/06/18 10:50:25, mue wrote:
> On 2013/06/17 07:45:43, dfc wrote:
> > i see below there is a `nothing` helper, would making these declarations
> > didSetCharm make(chan nothing), 
> > add anything, or is it just rearranging deck chairs ?
> 
> nothing is the instance of a struct{}. How about
> 
> type SignalChan chan struct{}
> var Signal = struct{}{}
> 
> in package util?

Interesting idea, especially in light of the NotifyWatcher stuff I recently
merged... those should perhaps be SignalWatchers? I'll let it marinade a bit.

https://codereview.appspot.com/10298043/diff/1/worker/uniter/filter.go#newcod...
worker/uniter/filter.go:104: didSetCharm:       make(chan struct{}),
On 2013/06/17 07:45:43, dfc wrote:
> i see below there is a `nothing` helper, would making these declarations
> didSetCharm make(chan nothing), 
> add anything, or is it just rearranging deck chairs ?

Thanks, but I think `var nothing = struct{}{}` is more useful than `type nothing
struct{}`; and if I were to name both of them I think it'd end up uglier. So
I'll stick with this for now.
Sign in to reply to this message.

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