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
Following on from #2690, there is a scenario that PR does not address if an exception occurs in the user's application.
If the exception bubbles out of our middleware our the normal Sentry exception handling mechanism will kick in in, so there's no problem.
However, if people use Activity.RecordException, we generate synthetic exceptions in our SentrySpanProcessor. This happens after Hub.RestoreScope is called however currently Hub.RestoreScope is only called for TransactionTracer spans... so if an exception occurs in a SpanTracer span, the Scope won't be restored properly before generating a synthetic exception and calling CaptureEvent... in which case the Scope won't be applied by SentryClient:
We should probably just always restore the scope in the SentrySpanProcessor.OnEnd callback, prior to generating exceptions or finishing any spans/transactions.
The text was updated successfully, but these errors were encountered:
Following on from #2690, there is a scenario that PR does not address if an exception occurs in the user's application.
If the exception bubbles out of our middleware our the normal Sentry exception handling mechanism will kick in in, so there's no problem.
However, if people use
Activity.RecordException
, we generate synthetic exceptions in our SentrySpanProcessor. This happens afterHub.RestoreScope
is called however currentlyHub.RestoreScope
is only called forTransactionTracer
spans... so if an exception occurs in a SpanTracer span, the Scope won't be restored properly before generating a synthetic exception and calling CaptureEvent... in which case the Scope won't be applied by SentryClient:sentry-dotnet/src/Sentry/SentryClient.cs
Lines 226 to 227 in 89a50ab
We should probably just always restore the scope in the
SentrySpanProcessor.OnEnd
callback, prior to generating exceptions or finishing any spans/transactions.The text was updated successfully, but these errors were encountered: