From ccc551112ba2165dd4142e519b2a4152e6b82990 Mon Sep 17 00:00:00 2001 From: Ta-Ching Chen Date: Sun, 24 Nov 2019 05:59:38 +0800 Subject: [PATCH] Fix poolmanager crashes when failed to list environment (#1432) --- pkg/executor/poolmgr/gpm.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/executor/poolmgr/gpm.go b/pkg/executor/poolmgr/gpm.go index 2501130d..3075e502 100644 --- a/pkg/executor/poolmgr/gpm.go +++ b/pkg/executor/poolmgr/gpm.go @@ -297,10 +297,11 @@ func (gpm *GenericPoolManager) eagerPoolCreator() { if err != nil { if utils.IsNetworkError(err) { gpm.logger.Error("encountered network error, retrying", zap.Error(err)) - time.Sleep(5 * time.Second) - continue + } else { + gpm.logger.Error("failed to get environment list", zap.Error(err)) } - gpm.logger.Error("failed to get environment list", zap.Error(err)) + time.Sleep(5 * time.Second) + continue } // Create pools for all envs. TODO: we should make this a bit less eager, only