From 6eb258b505837eb2fcfafe28ee0b73fffe1f10ac Mon Sep 17 00:00:00 2001 From: Andrew Martinez Date: Wed, 17 Apr 2024 15:33:11 -0400 Subject: [PATCH] remove debug output from non-erroring transport requests --- edge-apis/pool.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/edge-apis/pool.go b/edge-apis/pool.go index 859f3c25..d40a4ecc 100644 --- a/edge-apis/pool.go +++ b/edge-apis/pool.go @@ -178,12 +178,16 @@ func (c *ClientTransportPoolRandom) TryTransportForF(cb func(*ApiClientTransport activeKey = active.ApiUrl.String() result, err := cb(active) - if err == nil || !errorIndicatesControllerSwap(err) { - pfxlog.Logger().WithError(err).Debugf("determine a network error did not occur on (%T) returning", err) + if err == nil { + return result, err + } + + if !errorIndicatesControllerSwap(err) { + pfxlog.Logger().WithError(err).Debugf("determined that error (%T) does not indicate controller swap, returning error", err) return result, err } - pfxlog.Logger().WithError(err).Debugf("encountered network error (%T) while submitting request", err) + pfxlog.Logger().WithError(err).Debugf("encountered error (%T) while submitting request indicating controller swap", err) if c.pool.Count() == 1 { pfxlog.Logger().Debug("active transport failed, only 1 transport in pool")