You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just discovered that creation of new event log and sources is not thread safe. It is failing during our tests as they are executed in parallel.
if(System.Diagnostics.EventLog.SourceExists(source,log.MachineName)){varexistingLogWithSourceName=System.Diagnostics.EventLog.LogNameFromSourceName(source,log.MachineName);if(!string.IsNullOrWhiteSpace(existingLogWithSourceName)&&!log.Log.Equals(existingLogWithSourceName,StringComparison.OrdinalIgnoreCase)){// Remove the source from the previous log so we can associate it with the current log nameSystem.Diagnostics.EventLog.DeleteEventSource(source,log.MachineName);oldLogName=existingLogWithSourceName;}}else{System.Diagnostics.EventLog.CreateEventSource(sourceData);}
I just discovered that creation of new event log and sources is not thread safe. It is failing during our tests as they are executed in parallel.
https://github.com/serilog/serilog-sinks-eventlog/blob/dev/src/Serilog.Sinks.EventLog/Sinks/EventLog/EventLogSink.cs#L97
The text was updated successfully, but these errors were encountered: