-
Notifications
You must be signed in to change notification settings - Fork 945
Description
What happened?
Steps to Reproduce
There is an ongoing PR that reproduces the issue in a test. See https://github.com/open-telemetry/opentelemetry-js/pull/5928/files#r2406049422
Expected Result
The error callback should be called only once.
Actual Result
The callback is called twice.
Additional Details
The sendWithHttp method attaches a handler for the error event in the request object here
opentelemetry-js/experimental/packages/otlp-exporter-base/src/transport/http-transport-utils.ts
Line 95 in 8e9b8bb
| req.on('error', (error: Error) => { |
and afterwards it attaches the same handler in the the stream created for compression and for writing into the request in different places like here
opentelemetry-js/experimental/packages/otlp-exporter-base/src/transport/http-transport-utils.ts
Line 126 in 8e9b8bb
| dataStream.pipe(req).on('error', onError); |
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.