diff --git a/exporter/loadbalancingexporter/loadbalancer.go b/exporter/loadbalancingexporter/loadbalancer.go index a156ad9d9394..cccbc5c39245 100644 --- a/exporter/loadbalancingexporter/loadbalancer.go +++ b/exporter/loadbalancingexporter/loadbalancer.go @@ -148,7 +148,11 @@ func (lb *loadBalancer) removeExtraExporters(ctx context.Context, endpoints []st } for existing := range lb.exporters { if !endpointFound(existing, endpointsWithPort) { - _ = lb.exporters[existing].Shutdown(ctx) + exp := lb.exporters[existing] + // Shutdown the exporter asynchronously to avoid blocking the resolver + go func() { + _ = exp.Shutdown(ctx) + }() delete(lb.exporters, existing) } }