Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: Request correlation Guid should use existing one if present [1133]

$
0
0
HttpRequestMessageExtensions.GetCorrelationId() creates a new Guid and stores it as a property in the request. Tracing uses this ID to correlate all traces within a common request. ETW-based tracers are encouraged to write this same ID to System.Diagnostics.Trace.CorrelationManager.ActivityId so that ETW uses the same ID WebAPI does.

But when running web-hosted, ASP.NET effectively owns the ActivityID stored in the current CallContext and will always overwrite WebApi's anytime an 'await' is used to wait for a Task to complete. Customers have reported that exception filters and action filters get the wrong ActivityId -- it is because ASP.NET has overwritten WebApi's in the continuation of the Task that invoked the action. This happens in RTM as well as the 5.2 beta.

The advice from ASP.NET is for WebAPI (and customers) to use the existing ActivityId and not try to create one.

To fix this issue, HttpRequestMessageExtensions.GetCorrelationId should first check whether Trace.CorrelationManager.ActivityId has been set. If so, it should use it rather than Guid.NewGuid().
Comments: Fixed: https://aspnetwebstack.codeplex.com/SourceControl/changeset/9d727873a003cf947f9c88e6d672fe4dcb8e4a9a

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>