From 7a05bb2118c920d6d3ebfc215e9a97fbe58bdd63 Mon Sep 17 00:00:00 2001 From: Minyi Zhu Date: Wed, 22 Nov 2023 09:17:57 -0500 Subject: [PATCH] Fix error log during cluster check runner init (#20924) * pkg/autodiscovery/providers/clusterchecks.go * add release note * address comment * Update releasenotes/notes/fix_repeating_error_log_in_clc-7950ee986a560770.yaml Co-authored-by: Austin Lai <76412946+alai97@users.noreply.github.com> --------- Co-authored-by: Austin Lai <76412946+alai97@users.noreply.github.com> --- pkg/autodiscovery/providers/clusterchecks.go | 4 ++-- .../fix_repeating_error_log_in_clc-7950ee986a560770.yaml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/fix_repeating_error_log_in_clc-7950ee986a560770.yaml diff --git a/pkg/autodiscovery/providers/clusterchecks.go b/pkg/autodiscovery/providers/clusterchecks.go index 996540908c01bf..087cbea332446f 100644 --- a/pkg/autodiscovery/providers/clusterchecks.go +++ b/pkg/autodiscovery/providers/clusterchecks.go @@ -191,11 +191,11 @@ func (c *ClusterChecksConfigProvider) heartbeatSender(ctx context.Context) { postCtx, cancel := context.WithTimeout(ctx, postStatusTimeout) defer cancel() if err := c.postHeartbeat(postCtx); err == nil { - extraHeartbeatTime = currentTime log.Infof("Sent extra heartbeat at: %v", currentTime) } else { log.Warnf("Unable to send extra heartbeat to Cluster Agent, err: %v", err) } + extraHeartbeatTime = currentTime } case <-ctx.Done(): @@ -206,7 +206,7 @@ func (c *ClusterChecksConfigProvider) heartbeatSender(ctx context.Context) { func (c *ClusterChecksConfigProvider) postHeartbeat(ctx context.Context) error { if c.dcaClient == nil { - return errors.New("DCA Client not initialized by main provider, cannot post heartbeat") + return errors.New("DCA Client not initialized by main provider yet, cannot post heartbeat, wait for init completion") } status := types.NodeStatus{ diff --git a/releasenotes/notes/fix_repeating_error_log_in_clc-7950ee986a560770.yaml b/releasenotes/notes/fix_repeating_error_log_in_clc-7950ee986a560770.yaml new file mode 100644 index 00000000000000..1959a375768abb --- /dev/null +++ b/releasenotes/notes/fix_repeating_error_log_in_clc-7950ee986a560770.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fix a spewing error message ("DCA Client not initialized by main provider, cannot post heartbeat") in the cluster check runner log during CLC initialization.