Skip to content

Commit 830f2be

Browse files
committed
fix: rpcSpan closure logic in message-queues
1 parent d8cd0e7 commit 830f2be

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/publisher/message-queues.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,11 @@ export abstract class MessageQueue extends EventEmitter {
172172

173173
throw e;
174174
} finally {
175-
messages.forEach(m => {
176-
// We're finished with both the RPC and the whole publish operation,
177-
// so close out all of the related spans.
178-
rpcSpan?.end();
175+
// We're finished with both the RPC and the whole publish operation,
176+
// so close out all of the related spans.
177+
// rpcSpan must be closed only once
178+
rpcSpan?.end();
179+
messages.forEach(m => {
179180
tracing.PubsubEvents.publishEnd(m);
180181
m.parentSpan?.end();
181182
});

0 commit comments

Comments
 (0)