Skip to content

Commit

Permalink
[exporter/loadbalancing] Do not block resolver by the exporter shutdo…
Browse files Browse the repository at this point in the history
…wn (#31602)

This resolves the issues seen in
#31410
after merging
#31456
  • Loading branch information
dmitryax committed Mar 7, 2024
1 parent 291a2b5 commit dbae3a1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion exporter/loadbalancingexporter/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit dbae3a1

Please sign in to comment.