From da5f1592e732031145cad8658e7f51fb25b3e8cc Mon Sep 17 00:00:00 2001 From: Florian Bacher Date: Wed, 11 Dec 2024 07:59:16 +0100 Subject: [PATCH] close the channel for component status updates to avoid blocking Signed-off-by: Florian Bacher --- extension/opampextension/opamp_agent.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extension/opampextension/opamp_agent.go b/extension/opampextension/opamp_agent.go index c638e8727b05..3e26d407fd80 100644 --- a/extension/opampextension/opamp_agent.go +++ b/extension/opampextension/opamp_agent.go @@ -162,6 +162,9 @@ func (o *opampAgent) Shutdown(ctx context.Context) error { o.statusSubscriptionWg.Wait() o.componentHealthWg.Wait() + if o.componentStatusCh != nil { + close(o.componentStatusCh) + } o.logger.Debug("OpAMP agent shutting down...") if o.opampClient == nil {