Skip to content

Commit

Permalink
Ensure activity is closed after processing is completed for HttpInLis…
Browse files Browse the repository at this point in the history
…tener
  • Loading branch information
qhris committed Oct 11, 2023
1 parent 0e3495a commit 488d2ac
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ public static void StopAspNetActivity(TextMapPropagator textMapPropagator, Activ
Debug.Assert(context.Items[ContextKey] is ContextHolder, "Context item is not an ContextHolder instance.");

var currentActivity = Activity.Current;

aspNetActivity.Stop();
context.Items[ContextKey] = null;

try
Expand All @@ -144,6 +142,7 @@ public static void StopAspNetActivity(TextMapPropagator textMapPropagator, Activ
AspNetTelemetryEventSource.Log.CallbackException(aspNetActivity, "OnStopped", callbackEx);
}

aspNetActivity.Stop();
AspNetTelemetryEventSource.Log.ActivityStopped(aspNetActivity);

if (textMapPropagator is not TraceContextPropagator)
Expand Down

0 comments on commit 488d2ac

Please sign in to comment.