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

Unified Diff: state/machine.go

Issue 103770044: apiserver/admin: fix incorrect (down) status
Patch Set: apiserver/admin: fix incorrect (down) status Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « state/apiserver/server_test.go ('k') | state/machine_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: state/machine.go
=== modified file 'state/machine.go'
--- state/machine.go 2014-05-20 17:57:10 +0000
+++ state/machine.go 2014-06-02 12:07:49 +0000
@@ -650,13 +650,14 @@
return nil
}
-// AgentAlive returns whether the respective remote agent is alive.
-func (m *Machine) AgentAlive() (bool, error) {
- return m.st.pwatcher.Alive(m.globalKey())
+// AgentPresence returns whether the respective remote agent is alive.
+func (m *Machine) AgentPresence() (bool, error) {
+ b, err := m.st.pwatcher.Alive(m.globalKey())
+ return b, err
}
-// WaitAgentAlive blocks until the respective agent is alive.
-func (m *Machine) WaitAgentAlive(timeout time.Duration) (err error) {
+// WaitAgentPresence blocks until the respective agent is alive.
+func (m *Machine) WaitAgentPresence(timeout time.Duration) (err error) {
defer errors.Maskf(&err, "waiting for agent of machine %v", m)
ch := make(chan presence.Change)
m.st.pwatcher.Watch(m.globalKey(), ch)
@@ -676,9 +677,9 @@
panic(fmt.Sprintf("presence reported dead status twice in a row for machine %v", m))
}
-// SetAgentAlive signals that the agent for machine m is alive.
+// SetAgentPresence signals that the agent for machine m is alive.
// It returns the started pinger.
-func (m *Machine) SetAgentAlive() (*presence.Pinger, error) {
+func (m *Machine) SetAgentPresence() (*presence.Pinger, error) {
p := presence.NewPinger(m.st.presence, m.globalKey())
err := p.Start()
if err != nil {
« no previous file with comments | « state/apiserver/server_test.go ('k') | state/machine_test.go » ('j') | no next file with comments »

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