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 (open-telemetry#31602)

This resolves the issues seen in
open-telemetry#31410
after merging
open-telemetry#31456
  • Loading branch information
dmitryax authored and XinRanZhAWS committed Mar 13, 2024
1 parent 4d7dcaa commit d90d836
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 d90d836

Please sign in to comment.