From e9d5b1fb34113ad51a2cf481619b2268da54b259 Mon Sep 17 00:00:00 2001 From: Steven Soroka Date: Tue, 18 Aug 2020 11:27:58 -0400 Subject: [PATCH] fix minor agent race condition around error messages (#7999) --- agent/agent.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index f7ae32c95..e7ffee322 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -149,7 +149,7 @@ func (a *Agent) Run(ctx context.Context) error { wg.Add(1) go func() { defer wg.Done() - err = a.runOutputs(ou) + err := a.runOutputs(ou) if err != nil { log.Printf("E! [agent] Error running outputs: %v", err) } @@ -159,7 +159,7 @@ func (a *Agent) Run(ctx context.Context) error { wg.Add(1) go func() { defer wg.Done() - err = a.runProcessors(apu) + err := a.runProcessors(apu) if err != nil { log.Printf("E! [agent] Error running processors: %v", err) } @@ -168,7 +168,7 @@ func (a *Agent) Run(ctx context.Context) error { wg.Add(1) go func() { defer wg.Done() - err = a.runAggregators(startTime, au) + err := a.runAggregators(startTime, au) if err != nil { log.Printf("E! [agent] Error running aggregators: %v", err) } @@ -179,7 +179,7 @@ func (a *Agent) Run(ctx context.Context) error { wg.Add(1) go func() { defer wg.Done() - err = a.runProcessors(pu) + err := a.runProcessors(pu) if err != nil { log.Printf("E! [agent] Error running processors: %v", err) } @@ -189,7 +189,7 @@ func (a *Agent) Run(ctx context.Context) error { wg.Add(1) go func() { defer wg.Done() - err = a.runInputs(ctx, startTime, iu) + err := a.runInputs(ctx, startTime, iu) if err != nil { log.Printf("E! [agent] Error running inputs: %v", err) } @@ -944,7 +944,7 @@ func (a *Agent) test(ctx context.Context, wait time.Duration, outputC chan<- tel wg.Add(1) go func() { defer wg.Done() - err = a.runProcessors(apu) + err := a.runProcessors(apu) if err != nil { log.Printf("E! [agent] Error running processors: %v", err) } @@ -953,7 +953,7 @@ func (a *Agent) test(ctx context.Context, wait time.Duration, outputC chan<- tel wg.Add(1) go func() { defer wg.Done() - err = a.runAggregators(startTime, au) + err := a.runAggregators(startTime, au) if err != nil { log.Printf("E! [agent] Error running aggregators: %v", err) } @@ -964,7 +964,7 @@ func (a *Agent) test(ctx context.Context, wait time.Duration, outputC chan<- tel wg.Add(1) go func() { defer wg.Done() - err = a.runProcessors(pu) + err := a.runProcessors(pu) if err != nil { log.Printf("E! [agent] Error running processors: %v", err) } @@ -974,7 +974,7 @@ func (a *Agent) test(ctx context.Context, wait time.Duration, outputC chan<- tel wg.Add(1) go func() { defer wg.Done() - err = a.testRunInputs(ctx, wait, iu) + err := a.testRunInputs(ctx, wait, iu) if err != nil { log.Printf("E! [agent] Error running inputs: %v", err) } @@ -1060,7 +1060,7 @@ func (a *Agent) once(ctx context.Context, wait time.Duration) error { wg.Add(1) go func() { defer wg.Done() - err = a.runOutputs(ou) + err := a.runOutputs(ou) if err != nil { log.Printf("E! [agent] Error running outputs: %v", err) } @@ -1070,7 +1070,7 @@ func (a *Agent) once(ctx context.Context, wait time.Duration) error { wg.Add(1) go func() { defer wg.Done() - err = a.runProcessors(apu) + err := a.runProcessors(apu) if err != nil { log.Printf("E! [agent] Error running processors: %v", err) } @@ -1079,7 +1079,7 @@ func (a *Agent) once(ctx context.Context, wait time.Duration) error { wg.Add(1) go func() { defer wg.Done() - err = a.runAggregators(startTime, au) + err := a.runAggregators(startTime, au) if err != nil { log.Printf("E! [agent] Error running aggregators: %v", err) } @@ -1090,7 +1090,7 @@ func (a *Agent) once(ctx context.Context, wait time.Duration) error { wg.Add(1) go func() { defer wg.Done() - err = a.runProcessors(pu) + err := a.runProcessors(pu) if err != nil { log.Printf("E! [agent] Error running processors: %v", err) } @@ -1100,7 +1100,7 @@ func (a *Agent) once(ctx context.Context, wait time.Duration) error { wg.Add(1) go func() { defer wg.Done() - err = a.testRunInputs(ctx, wait, iu) + err := a.testRunInputs(ctx, wait, iu) if err != nil { log.Printf("E! [agent] Error running inputs: %v", err) }