You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 17, 2026. It is now read-only.
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
Enable OpenTelemetry by setting enableOpenTelemetryTracing: true in the PubSub constructor
Try to send more than one message at the same time
See messages like Cannot execute the operation on ended Span {traceId: e60f51b12990ebe1359223f4db06b98e, spanId: 01c61e673f5ed52e} and send e60f51b12990ebe1359223f4db06b98e-01c61e673f5ed52e - You can only call end() on a span once. in the console
A clear and concise description of what the bug is, and what you expected to happen.
The OpenTelemetry span could be ended only once. But MessageQueue._publish method could close rpcSpan and message parent spans more than once if it has more than one message to process, because closing spans is implemented in the loop:
// We're finished with both the RPC and the whole publish operation,
// so close out all of the related spans.
rpcSpan?.end();
tracing.PubsubEvents.publishEnd(m);
m.parentSpan?.end();
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
enableOpenTelemetryTracing: truein thePubSubconstructorCannot execute the operation on ended Span {traceId: e60f51b12990ebe1359223f4db06b98e, spanId: 01c61e673f5ed52e}andsend e60f51b12990ebe1359223f4db06b98e-01c61e673f5ed52e - You can only call end() on a span once.in the consoleA clear and concise description of what the bug is, and what you expected to happen.
The OpenTelemetry span could be ended only once. But
MessageQueue._publishmethod could closerpcSpanand message parent spans more than once if it has more than one message to process, because closing spans is implemented in the loop:nodejs-pubsub/src/publisher/message-queues.ts
Lines 175 to 180 in 91ebe73
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
There are no docs describing OpenTelemetry
span.endbehaviour. However, you could see that it is forbidden in the Otel source code:https://github.com/open-telemetry/opentelemetry-js/blob/5333204134f71f42c4612735106f83fa8c691102/packages/opentelemetry-sdk-trace-base/src/Span.ts#L267-L272