Skip to content

Commit

Permalink
netty client: don't finish parent span (#7126)
Browse files Browse the repository at this point in the history
  • Loading branch information
amarziali committed Jun 4, 2024
1 parent 9f6d75c commit 244260b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception {
parentAttr.setIfAbsent(noopSpan());
final AgentSpan parent = parentAttr.get();
final AgentSpan span = ctx.channel().attr(SPAN_ATTRIBUTE_KEY).getAndSet(parent);
if (span != null) {
if (span != null && span != parent) {
try (final AgentScope scope = activateSpan(span)) {
DECORATE.beforeFinish(span);
span.finish();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception {
parentAttr.setIfAbsent(noopSpan());
final AgentSpan parent = parentAttr.get();
final AgentSpan span = ctx.channel().attr(SPAN_ATTRIBUTE_KEY).getAndSet(parent);
if (span != null) {
if (span != null && span != parent) {
try (final AgentScope scope = activateSpan(span)) {
DECORATE.beforeFinish(span);
span.finish();
Expand Down

0 comments on commit 244260b

Please sign in to comment.