-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-Tracing-coreclrbacklog-cleanup-candidateAn inactive issue that has been marked for automated closure.An inactive issue that has been marked for automated closure.no-recent-activity
Milestone
Description
Run the following program to reproduce the problem:
class Program
{
static void Main(string[] args)
{
var aSource = new AlphaSource();
var bSource = new BravoSource();
using (var al = new AlphaListener())
{
aSource.AlphaMessage("A1");
bSource.BravoMessage("B1");
using (var bl = new BravoListener())
{
aSource.AlphaMessage("A2");
bSource.BravoMessage("B2");
aSource.Write("Dynamic", new { Message = "A3 dynamic" });
Console.ReadKey();
}
}
}
}
[EventSource(Name ="Alpha")]
class AlphaSource: EventSource
{
[Event(1)]
public void AlphaMessage(string arg)
{
this.WriteEvent(1, arg);
}
}
[EventSource(Name = "Bravo")]
class BravoSource : EventSource
{
[Event(1)]
public void BravoMessage(string arg)
{
this.WriteEvent(1, arg);
}
}
class AlphaListener : EventListener
{
protected override void OnEventWritten(EventWrittenEventArgs eventData)
{
Console.WriteLine($"AlphaListener: got event from {eventData.EventSource.Name}: {eventData.Payload[0]}");
}
protected override void OnEventSourceCreated(EventSource source)
{
if (source is AlphaSource)
{
this.EnableEvents(source, EventLevel.LogAlways, (EventKeywords) (-1));
}
}
}
class BravoListener : EventListener
{
protected override void OnEventWritten(EventWrittenEventArgs eventData)
{
Console.WriteLine($"BravoListener: got event from {eventData.EventSource.Name}: {eventData.Payload[0]}");
}
protected override void OnEventSourceCreated(EventSource source)
{
if (source is BravoSource)
{
this.EnableEvents(source, EventLevel.LogAlways, (EventKeywords)(-1));
}
}
}Talked to @vancem , he thinks it is a legitimate issue in DispatchToAllListeners implementation, specifically the eventId == -1 in the code if (eventId == -1 || dispatcher.m_EventEnabled[eventId])
Metadata
Metadata
Assignees
Labels
area-Tracing-coreclrbacklog-cleanup-candidateAn inactive issue that has been marked for automated closure.An inactive issue that has been marked for automated closure.no-recent-activity