From f97bfd5be8ecd79240ec7b43e3e191938e24e2ca Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 2 Jul 2018 20:50:00 -0700 Subject: [PATCH] agent: address some basic feedback --- agent/checks/alias.go | 8 ++++---- agent/local/state.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/agent/checks/alias.go b/agent/checks/alias.go index 9622c896c3..5a40693c54 100644 --- a/agent/checks/alias.go +++ b/agent/checks/alias.go @@ -17,7 +17,7 @@ const ( ) // CheckAlias is a check type that aliases the health of another service -// instance. If the service aliased has any critical health checks, then +// instance or node. If the service aliased has any critical health checks, then // this check is critical. If the service has no critical but warnings, // then this check is warning, and if a service has only passing checks, then // this check is passing. @@ -46,7 +46,7 @@ type AliasNotifier interface { Checks() map[types.CheckID]*structs.HealthCheck } -// Start is used to start a check ttl, runs until Stop() func (c *CheckAlias) Start() { +// Start is used to start the check, runs until Stop() func (c *CheckAlias) Start() { func (c *CheckAlias) Start() { c.stopLock.Lock() defer c.stopLock.Unlock() @@ -55,7 +55,7 @@ func (c *CheckAlias) Start() { go c.run(c.stopCh) } -// Stop is used to stop a check ttl. +// Stop is used to stop the check. func (c *CheckAlias) Stop() { c.stopLock.Lock() defer c.stopLock.Unlock() @@ -132,7 +132,7 @@ func (c *CheckAlias) runQuery(stopCh chan struct{}) { // NOTE(mitchellh): This currently returns ALL health checks for // a node even though we also have the service ID. This can be // optimized if we introduce a new RPC endpoint to filter both, - // but for blocking queries isn't that more efficient since the checks + // but for blocking queries isn't that much more efficient since the checks // index is global to the cluster. var out structs.IndexedHealthChecks if err := c.RPC.RPC("Health.NodeChecks", &args, &out); err != nil { diff --git a/agent/local/state.go b/agent/local/state.go index 6f90353565..1f15f231a9 100644 --- a/agent/local/state.go +++ b/agent/local/state.go @@ -528,7 +528,7 @@ func (l *State) UpdateCheck(id types.CheckID, status, output string) { // Do not block. All notify channels should be buffered to at // least 1 in which case not-blocking does not result in loss // of data because a failed send means a notification is - // already queued. + // already queued. This must be called with the lock held. select { case notifyCh <- struct{}{}: default: