1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-06-25 00:16:49 +02:00

Shutdown underlying span exporter while shutting down BatchSpanProcessor (#1443)

* Fix BatchSpanProcessor does not shutdown underlying span exporter

* Update CHANGELOG

* Fix tests

* Update CHANGELOG.md
This commit is contained in:
Sam Xie
2021-01-14 09:14:03 +08:00
committed by GitHub
parent dfece3d2b9
commit c29c6fd1ad
3 changed files with 24 additions and 6 deletions

View File

@ -132,6 +132,11 @@ func (bsp *BatchSpanProcessor) Shutdown(ctx context.Context) error {
go func() {
close(bsp.stopCh)
bsp.stopWait.Wait()
if bsp.e != nil {
if err := bsp.e.Shutdown(ctx); err != nil {
otel.Handle(err)
}
}
close(wait)
}()
// Wait until the wait group is done or the context is cancelled