Skip to content

Commit

Permalink
Ensure that SendAsync does not end a Span it didn't created (#3243)
Browse files Browse the repository at this point in the history
  • Loading branch information
preardon authored Aug 7, 2024
1 parent bcf4a56 commit 3430d02
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Paramore.Brighter/CommandProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,14 @@ await handlerChain.First().HandleAsync(command, cancellationToken)
}
catch (Exception)
{
span.span?.SetStatus(ActivityStatusCode.Error);
if (span.created)
span.span?.SetStatus(ActivityStatusCode.Error);
throw;
}
finally
{
EndSpan(span.span);
if (span.created)
EndSpan(span.span);
}
}
}
Expand Down

0 comments on commit 3430d02

Please sign in to comment.