-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Test Failure] EventSource_SendingRequest_PathAndQueryRedaction_LogsStartStop #106268
Comments
Tagging subscribers to this area: @dotnet/ncl |
The check fails at runtime/src/libraries/System.Net.Http/tests/FunctionalTests/TelemetryTest.cs Lines 665 to 666 in 8cc102f
Which is weird because the check above it passes runtime/src/libraries/System.Net.Http/tests/FunctionalTests/TelemetryTest.cs Lines 662 to 663 in 8cc102f
But both counters are using the same underlying field runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpTelemetry.AnyOS.cs Lines 50 to 61 in 9ffdb53
|
#105548 introduces a new race condition where the first increment reported by an Consider the following repro project that always prints a Simplified repro projectusing System.Diagnostics.Tracing;
using var listener = new Listener();
var log = MyEventSource.Log;
// If you add some delay, you will see the increment=1 on .NET 9 as well
// Thread.Sleep(1000);
log.SomeInterestingValue++;
Console.ReadKey();
class MyEventSource : EventSource
{
public static MyEventSource Log { get; } = new();
private IncrementingPollingCounter? _couter;
public int SomeInterestingValue;
private MyEventSource() : base(nameof(MyEventSource)) { }
protected override void OnEventCommand(EventCommandEventArgs command)
{
if (command.Command == EventCommand.Enable)
{
_couter ??= new IncrementingPollingCounter("counter", this, () => SomeInterestingValue);
}
}
}
class Listener : EventListener
{
protected override void OnEventSourceCreated(EventSource eventSource)
{
if (eventSource.Name != nameof(MyEventSource)) return;
EnableEvents(eventSource, EventLevel.Informational, EventKeywords.None,
new Dictionary<string, string?> { { "EventCounterIntervalSec", 0.5f.ToString() } });
}
protected override void OnEventWritten(EventWrittenEventArgs eventData)
{
if (eventData.EventSource.Name != nameof(MyEventSource)) return;
var counters = (IDictionary<string, object>)eventData.Payload![0]!;
Console.WriteLine($"Increment: {counters["Increment"]}");
}
} I'm assuming this wasn't intentional? |
While it wasn't an explicit goal to break such a test, it was intentional to make that callback asynchronous. All calls to EventListener.OnEventSourceCreated() are holding a lock and invoking an IncrementingEventCounter callback function while holding that lock can lead to a deadlock (the issue that #105548 was fixing). More discussion about the tests for those counters here: dotnet/aspnetcore#57259 |
Build Information
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=768382
Build error leg or test failing: System.Net.Http.Functional.Tests.TelemetryTest_Http11.EventSource_SendingRequest_PathAndQueryRedaction_LogsStartStop
Pull request:
Error Message
Fill the error message using step by step known issues guidance.
Example failure
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=768382
Error message validated:
[System.Net.Http.Functional.Tests.TelemetryTest.ValidateEventCounters Assert.Contains() Failure: Filter not matched in collection
]Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 8/12/2024 1:44:58 PM UTC
Report
Summary
The text was updated successfully, but these errors were encountered: