From d5907b2a2e86aafcaf70a5be794512cc23a23777 Mon Sep 17 00:00:00 2001 From: Seebs Date: Fri, 29 Mar 2019 17:29:21 -0500 Subject: [PATCH] lint fixes to cluster behavior in utils test This is more lint fixes, but it's less obvious to me what the right handling for errors is, or whether disregarding them is safe, so it's a separate commit. --- utils_internal_test.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/utils_internal_test.go b/utils_internal_test.go index 3396cb4e9..2f21fb04b 100644 --- a/utils_internal_test.go +++ b/utils_internal_test.go @@ -235,7 +235,9 @@ func (t *ClusterCluster) addCluster(i int, saveTopology bool) (*cluster, error) // add nodes if saveTopology { for _, n := range t.common.Nodes { - c.addNode(n) + if err := c.addNode(n); err != nil { + return nil, err + } } } @@ -314,7 +316,10 @@ func (b bcast) SendSync(m Message) error { // Apply the send message to all nodes (except the coordinator). for _, c := range b.t.Clusters { if c != b.c { - c.mergeClusterStatus(obj) + err := c.mergeClusterStatus(obj) + if err != nil { + return err + } } } b.t.mu.RLock() @@ -348,7 +353,9 @@ func (b bcast) SendTo(to *Node, m Message) error { } case *ResizeInstructionComplete: coord := b.t.clusterByID(to.ID) - go coord.markResizeInstructionComplete(obj) + // this used to be async, but that prevented us from checking + // its error status... + return coord.markResizeInstructionComplete(obj) case *ClusterStatus: // Apply the send message to the node. for _, c := range b.t.Clusters {