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

Issue 6498091: mstate: added agent alive methods (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 8 months ago by TheMue
Modified:
11 years, 8 months ago
Reviewers:
mp+122819
Visibility:
Public.

Description

mstate: added agent alive methods Machine provides AgentAlive(), WaitAgentAlive() and SetAgentAlive() using the presence package. https://code.launchpad.net/~themue/juju-core/go-mstate-machine-agent-alive/+merge/122819 Requires: https://code.launchpad.net/~themue/juju-core/go-mstate-unit-status/+merge/122500 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 12

Patch Set 2 : mstate: added agent alive methods #

Unified diffs Side-by-side diffs Delta from patch set Stats (+100 lines, -3 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M mstate/machine.go View 1 3 chunks +50 lines, -0 lines 0 comments Download
M mstate/machine_test.go View 1 2 chunks +45 lines, -0 lines 0 comments Download
M mstate/unit_test.go View 1 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 3
TheMue
Please take a look.
11 years, 8 months ago (2012-09-05 09:13:27 UTC) #1
niemeyer
Nice, LGTM. https://codereview.appspot.com/6498091/diff/1/mstate/machine.go File mstate/machine.go (right): https://codereview.appspot.com/6498091/diff/1/mstate/machine.go#newcode82 mstate/machine.go:82: func (m *Machine) WaitAgentAlive(timeout time.Duration) error { ...
11 years, 8 months ago (2012-09-05 21:28:27 UTC) #2
TheMue
11 years, 8 months ago (2012-09-06 17:05:56 UTC) #3
*** Submitted:

mstate: added agent alive methods

Machine provides AgentAlive(), WaitAgentAlive() and
SetAgentAlive() using the presence package.

R=niemeyer
CC=
https://codereview.appspot.com/6498091

https://codereview.appspot.com/6498091/diff/1/mstate/machine.go
File mstate/machine.go (right):

https://codereview.appspot.com/6498091/diff/1/mstate/machine.go#newcode82
mstate/machine.go:82: func (m *Machine) WaitAgentAlive(timeout time.Duration)
error {
On 2012/09/05 21:28:28, niemeyer wrote:
> Nice implementation.

Thanks.

https://codereview.appspot.com/6498091/diff/1/mstate/machine.go#newcode101
mstate/machine.go:101: panic(fmt.Sprintf("unexpected alive status of machine
%v", m))
On 2012/09/05 21:28:28, niemeyer wrote:
> "presence reported dead status twice in a row for machine %v"

Done.

https://codereview.appspot.com/6498091/diff/1/mstate/machine.go#newcode109
mstate/machine.go:109: // by starting a pinger on its presence node. It returns
the
On 2012/09/05 21:28:28, niemeyer wrote:
> Please drop the "by starting a pinger on its presence node" part. This isn't
> entirely true anymore, and isn't really necessary given the rest of the doc.

Done.

https://codereview.appspot.com/6498091/diff/1/mstate/machine_test.go
File mstate/machine_test.go (right):

https://codereview.appspot.com/6498091/diff/1/mstate/machine_test.go#newcode31
mstate/machine_test.go:31: defer pinger.Kill()
On 2012/09/05 21:28:28, niemeyer wrote:
> s/Kill/Stop/
> 
> We only care that it's not running after the test is done.

Done.

https://codereview.appspot.com/6498091/diff/1/mstate/machine_test.go#newcode50
mstate/machine_test.go:50: c.Assert(pinger, Not(IsNil))
On 2012/09/05 21:28:28, niemeyer wrote:
> This check isn't necessary. We'd go crazy if we had to check everything that
is
> *not* nil when err is nil.

Done.

https://codereview.appspot.com/6498091/diff/1/mstate/machine_test.go#newcode60
mstate/machine_test.go:60: pinger.Kill()
On 2012/09/05 21:28:28, niemeyer wrote:
> err := pinger.Kill()
> c.Assert(err, IsNil)

Done.
Sign in to reply to this message.

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