Skip to content

HttpHandlerDiagnosticListener might emit HttpRequestOut.Start 2 times for certain hosts with ActivityIdFormat.W3C #112792

@antonfirsov

Description

@antonfirsov

#112426 captures 2 test failures: TestW3CHeadersTraceStateAndCorrelationContext is a test bug to be fixed by #112753. However the test TestW3CHeaders also fails on this assertion, which seems to be a product bug.

The reason behind the failure is that when

  1. HttpClient is used (vs HttpWebRequest)
  2. With ActivityIdFormat.W3C (vs the default Hierarchical format)
  3. To certain endpoints (eg. to http://corefx-net-http11.azurewebsites.net/Echo.ashx but not http://example.com)

the event System.Net.Http.Desktop.HttpRequestOut.Start is emitted 2 times for the same HttpWebRequest. There are no multiple physical requests being sent. All 3 conditions have to be met.

A minimal repro can be found here.

My guess is this bug has been around for a long time, and no user reported it, so I would assess the priority as low, but I'm letting the owners to triage.

Related: #38152

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions