BatchSpanProcessor ExportResult other than SUCCESS causes UnhandledPromiseRejectionWarning: 1 #1617
Labels
bug
Something isn't working
up-for-grabs
Good for taking. Extra help will be provided by maintainers
With
@opentelemtry/tracing v0.12.0
we are observing unhandled promise rejections caused by the BatchSpanExporter not exporting results successfully https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-tracing/src/export/BatchSpanProcessor.ts#L110While we use Node 14, we already exit on unhandled promise rejections as done by default on Node 15 (nodejs/TSC#916) so an unhandled rejection is causing our processes to exit. Additionally the issue is challenging to pin down as the rejection value is a plain number, so the generated stack traces aren't really valuable.
Example trace:
How would a fix here look like? Add
.catch()
to each invocation ofthis._flush()
as done here https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-tracing/src/export/BatchSpanProcessor.ts#L121? Or just remove the reject https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-tracing/src/export/BatchSpanProcessor.ts#L110 and rely on the global error logger (which similar to #1569 I assume)?We are using the jaeger exporter, which is already logging the error itself https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-exporter-jaeger/src/jaeger.ts#L139-L141
The text was updated successfully, but these errors were encountered: