Skip to content

Commit 83f7e88

Browse files
dmitryaxDougManton
authored andcommitted
[exporter/loadbalancing] Do not block resolver by the exporter shutdown (open-telemetry#31602)
This resolves the issues seen in open-telemetry#31410 after merging open-telemetry#31456
1 parent a7cf049 commit 83f7e88

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

exporter/loadbalancingexporter/loadbalancer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ func (lb *loadBalancer) removeExtraExporters(ctx context.Context, endpoints []st
148148
}
149149
for existing := range lb.exporters {
150150
if !endpointFound(existing, endpointsWithPort) {
151-
_ = lb.exporters[existing].Shutdown(ctx)
151+
exp := lb.exporters[existing]
152+
// Shutdown the exporter asynchronously to avoid blocking the resolver
153+
go func() {
154+
_ = exp.Shutdown(ctx)
155+
}()
152156
delete(lb.exporters, existing)
153157
}
154158
}

0 commit comments

Comments
 (0)