From 31757a68a9e787b906045e7a402295bb3b1f7eee Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Mon, 25 Jan 2021 20:29:34 -0800 Subject: [PATCH] Fix race condition --- server/manager.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/manager.go b/server/manager.go index 4f92762..1798ec0 100644 --- a/server/manager.go +++ b/server/manager.go @@ -60,6 +60,7 @@ func (m *Manager) initializeFromRemoteSource(ctx context.Context, client remote. pool := workerpool.New(runtime.NumCPU()) log.Debugf("using %d workerpools to instantiate server instances", runtime.NumCPU()) for _, data := range servers { + data := data pool.Submit(func() { // Parse the json.RawMessage into an expected struct value. We do this here so that a single broken // server does not cause the entire boot process to hang, and allows us to show more useful error